@amos.com/node 0.1.60 → 0.1.61

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/openapi/schema.ts CHANGED
@@ -88,6 +88,8 @@ export interface paths {
88
88
  * Create or reuse a customer
89
89
  * @description Creates a registered customer, or returns the existing customer when
90
90
  * `email` or `phone` already belongs to one in the organization.
91
+ * When `email` is sent, reuse is by email only; a phone match is not used
92
+ * as a fallback, so a mistyped email cannot attach to another customer.
91
93
  * Reuse does not update the existing record; use PUT to change it.
92
94
  * Returns 200 for reuse and 201 for create.
93
95
  */
@@ -971,7 +973,10 @@ export interface paths {
971
973
  };
972
974
  get?: never;
973
975
  put?: never;
974
- /** Create a new setup intent */
976
+ /**
977
+ * Create a new setup intent
978
+ * @description Creates an organization-scoped setup intent. X-Account-Id is ignored if sent. The customer must belong to the authenticated organization. Returns an embed token whose JWT payload includes organization_id and setup_intent_id.
979
+ */
975
980
  post: operations["CreateSetupIntent"];
976
981
  delete?: never;
977
982
  options?: never;
@@ -1247,13 +1252,33 @@ export interface components {
1247
1252
  [key: string]: string[];
1248
1253
  };
1249
1254
  };
1250
- /** @description Decoded JWT payload for embed token responses. */
1255
+ /**
1256
+ * @description Decoded JWT payload for embed token responses.
1257
+ *
1258
+ * Payment intent tokens include `account_id` and `payment_intent_id`.
1259
+ * Setup intent tokens include `organization_id` and `setup_intent_id`
1260
+ * and do not use `account_id`. Unused fields are null.
1261
+ */
1251
1262
  EmbedTokenJwt: {
1252
- /** Format: uuid */
1253
- account_id?: string;
1254
- /** Format: uuid */
1263
+ /**
1264
+ * Format: uuid
1265
+ * @description Present for payment intent embed tokens. Null for setup intents.
1266
+ */
1267
+ account_id?: string | null;
1268
+ /**
1269
+ * Format: uuid
1270
+ * @description Present for setup intent embed tokens. Null for payment intents.
1271
+ */
1272
+ organization_id?: string | null;
1273
+ /**
1274
+ * Format: uuid
1275
+ * @description Present for payment intent embed tokens. Null for setup intents.
1276
+ */
1255
1277
  payment_intent_id?: string | null;
1256
- /** Format: uuid */
1278
+ /**
1279
+ * Format: uuid
1280
+ * @description Present for setup intent embed tokens. Null for payment intents.
1281
+ */
1257
1282
  setup_intent_id?: string | null;
1258
1283
  };
1259
1284
  /** @description Decoded JWT payload for render token responses. */
@@ -1266,7 +1291,13 @@ export interface components {
1266
1291
  render_template_id?: string;
1267
1292
  };
1268
1293
  EmbedToken: {
1269
- /** @description JWT string used for embedded payment and setup intent flows. When decoded, the JWT payload matches the EmbedTokenJwt schema. */
1294
+ /**
1295
+ * @description JWT string used for embedded payment and setup intent flows.
1296
+ * When decoded, the JWT payload matches the EmbedTokenJwt schema.
1297
+ * Setup intent tokens are organization-scoped (`organization_id` +
1298
+ * `setup_intent_id`). Payment intent tokens remain account-scoped
1299
+ * (`account_id` + `payment_intent_id`).
1300
+ */
1270
1301
  token?: string;
1271
1302
  ttl?: number;
1272
1303
  };
@@ -1491,12 +1522,9 @@ export interface components {
1491
1522
  /** Format: date-time */
1492
1523
  updated_at?: string;
1493
1524
  };
1494
- /** @enum {string} */
1495
- DunningConfigurationExhaustedActionType: "cancel" | "pause" | "none";
1496
1525
  CreateDunningConfigurationInput: {
1497
1526
  /** @description Days after a failed collection to retry, in ascending order. */
1498
1527
  retry_days: number[];
1499
- exhausted_action?: components["schemas"]["DunningConfigurationExhaustedActionType"];
1500
1528
  enabled?: boolean;
1501
1529
  };
1502
1530
  CreateDunningConfigurationRequest: {
@@ -1504,7 +1532,6 @@ export interface components {
1504
1532
  };
1505
1533
  UpdateDunningConfigurationInput: {
1506
1534
  retry_days?: number[];
1507
- exhausted_action?: components["schemas"]["DunningConfigurationExhaustedActionType"];
1508
1535
  enabled?: boolean;
1509
1536
  };
1510
1537
  UpdateDunningConfigurationRequest: {
@@ -1514,7 +1541,6 @@ export interface components {
1514
1541
  /** Format: uuid */
1515
1542
  id?: string;
1516
1543
  retry_days?: number[];
1517
- exhausted_action?: components["schemas"]["DunningConfigurationExhaustedActionType"];
1518
1544
  enabled?: boolean;
1519
1545
  /** Format: date-time */
1520
1546
  created_at?: string;
@@ -2447,7 +2473,10 @@ export interface components {
2447
2473
  origins: components["schemas"]["Origin"][];
2448
2474
  };
2449
2475
  CreateSetupIntentInput: {
2450
- /** Format: uuid */
2476
+ /**
2477
+ * Format: uuid
2478
+ * @description Customer on the authenticated organization.
2479
+ */
2451
2480
  customer_id?: string;
2452
2481
  metadata?: components["schemas"]["Metadata"];
2453
2482
  };
@@ -2468,8 +2497,16 @@ export interface components {
2468
2497
  SetupIntent: {
2469
2498
  /** Format: uuid */
2470
2499
  id?: string;
2471
- /** Format: uuid */
2472
- account_id?: string;
2500
+ /**
2501
+ * Format: uuid
2502
+ * @description Legacy account association. Null for organization-scoped setup intents.
2503
+ */
2504
+ account_id?: string | null;
2505
+ /**
2506
+ * Format: uuid
2507
+ * @description Organization that owns the setup intent.
2508
+ */
2509
+ organization_id?: string;
2473
2510
  /** Format: uuid */
2474
2511
  customer_id?: string;
2475
2512
  metadata?: components["schemas"]["Metadata"];
@@ -2977,7 +3014,10 @@ export interface operations {
2977
3014
  "application/json": components["schemas"]["Customer"];
2978
3015
  };
2979
3016
  };
2980
- /** @description Email and phone match different customers */
3017
+ /**
3018
+ * @description Email and phone match different customers, or the email is new and
3019
+ * the phone already belongs to another customer.
3020
+ */
2981
3021
  409: {
2982
3022
  headers: {
2983
3023
  [name: string]: unknown;
@@ -5663,7 +5703,6 @@ export const bankAccountProfileFailure_reasonValues: ReadonlyArray<FlattenedDeep
5663
5703
  export const cardProfileFailure_reasonValues: ReadonlyArray<FlattenedDeepRequired<components>["schemas"]["CardProfile"]["failure_reason"]> = ["authorization_failed", "avs_blocked", "brand_not_allowed", "brand_not_found", "cvc_blocked", "processing_error", "vault_failed"];
5664
5704
  export const chargeAllowed_reverse_actionValues: ReadonlyArray<FlattenedDeepRequired<components>["schemas"]["Charge"]["allowed_reverse_action"]> = ["void", "refund"];
5665
5705
  export const chargeStateValues: ReadonlyArray<FlattenedDeepRequired<components>["schemas"]["Charge"]["state"]> = ["cancelled", "errored", "failed", "processing", "requires_capture", "requires_confirmation", "requires_review", "settlement_failed", "succeeded"];
5666
- export const dunningConfigurationExhaustedActionTypeValues: ReadonlyArray<FlattenedDeepRequired<components>["schemas"]["DunningConfigurationExhaustedActionType"]> = ["cancel", "pause", "none"];
5667
5706
  export const externalAccountTypeValues: ReadonlyArray<FlattenedDeepRequired<components>["schemas"]["ExternalAccount"]["type"]> = ["external_card", "external_bank_account"];
5668
5707
  export const legalEntityEntityTypeValues: ReadonlyArray<FlattenedDeepRequired<components>["schemas"]["LegalEntityEntityType"]> = ["individual_sole_proprietorship", "corporation", "limited_liability_company", "partnership", "limited_partnership", "general_partnership", "tax_exempt_organization", "government_agency"];
5669
5708
  export const legalEntityOwnershipTypeValues: ReadonlyArray<FlattenedDeepRequired<components>["schemas"]["LegalEntityOwnershipType"]> = ["public", "private"];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@amos.com/node",
3
- "version": "0.1.60",
3
+ "version": "0.1.61",
4
4
  "description": "Node.js client for the Amos Pay API.",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",