@amos.com/node 0.1.59 → 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
@@ -84,7 +84,15 @@ export interface paths {
84
84
  /** List all customers */
85
85
  get: operations["ListCustomers"];
86
86
  put?: never;
87
- /** Create a new customer */
87
+ /**
88
+ * Create or reuse a customer
89
+ * @description Creates a registered customer, or returns the existing customer when
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.
93
+ * Reuse does not update the existing record; use PUT to change it.
94
+ * Returns 200 for reuse and 201 for create.
95
+ */
88
96
  post: operations["CreateCustomer"];
89
97
  delete?: never;
90
98
  options?: never;
@@ -564,26 +572,6 @@ export interface paths {
564
572
  patch?: never;
565
573
  trace?: never;
566
574
  };
567
- "/embed/payment_intents/{id}/confirm_with_payment_method": {
568
- parameters: {
569
- query?: never;
570
- header?: never;
571
- path?: never;
572
- cookie?: never;
573
- };
574
- get?: never;
575
- put?: never;
576
- /**
577
- * Confirm a payment intent with a new payment method (async)
578
- * @description Legacy async confirmation for migration. Accepts a payment method, enqueues authorization or sale work, and returns 202 with processing_authorization or processing_sale. Prefer POST /embed/payment_intents/{id}/confirm for synchronous processor confirmation.
579
- */
580
- post: operations["ConfirmEmbedPaymentIntentWithPaymentMethod"];
581
- delete?: never;
582
- options?: never;
583
- head?: never;
584
- patch?: never;
585
- trace?: never;
586
- };
587
575
  "/payment_intents": {
588
576
  parameters: {
589
577
  query?: never;
@@ -910,7 +898,11 @@ export interface paths {
910
898
  };
911
899
  /** Retrieve a render template by ID */
912
900
  get: operations["GetRenderTemplate"];
913
- put?: never;
901
+ /**
902
+ * Update a render template by ID
903
+ * @description Replaces the template's origin allowlist. Currency, allowed payment methods, and billing address options cannot be changed.
904
+ */
905
+ put: operations["UpdateRenderTemplate"];
914
906
  post?: never;
915
907
  delete?: never;
916
908
  options?: never;
@@ -972,7 +964,7 @@ export interface paths {
972
964
  patch?: never;
973
965
  trace?: never;
974
966
  };
975
- "/embed/setup_intents/{id}/confirm_with_payment_method": {
967
+ "/setup_intents": {
976
968
  parameters: {
977
969
  query?: never;
978
970
  header?: never;
@@ -982,26 +974,9 @@ export interface paths {
982
974
  get?: never;
983
975
  put?: never;
984
976
  /**
985
- * Confirm a setup intent with a new payment method (async)
986
- * @description Legacy async confirmation for migration. Accepts a payment method and, for cards, enqueues verification. Returns 202 with verifying or succeeded. Prefer POST /embed/setup_intents/{id}/confirm for synchronous confirmation.
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.
987
979
  */
988
- post: operations["ConfirmSetupIntentWithPaymentMethod"];
989
- delete?: never;
990
- options?: never;
991
- head?: never;
992
- patch?: never;
993
- trace?: never;
994
- };
995
- "/setup_intents": {
996
- parameters: {
997
- query?: never;
998
- header?: never;
999
- path?: never;
1000
- cookie?: never;
1001
- };
1002
- get?: never;
1003
- put?: never;
1004
- /** Create a new setup intent */
1005
980
  post: operations["CreateSetupIntent"];
1006
981
  delete?: never;
1007
982
  options?: never;
@@ -1277,13 +1252,33 @@ export interface components {
1277
1252
  [key: string]: string[];
1278
1253
  };
1279
1254
  };
1280
- /** @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
+ */
1281
1262
  EmbedTokenJwt: {
1282
- /** Format: uuid */
1283
- account_id?: string;
1284
- /** 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
+ */
1285
1277
  payment_intent_id?: string | null;
1286
- /** Format: uuid */
1278
+ /**
1279
+ * Format: uuid
1280
+ * @description Present for setup intent embed tokens. Null for payment intents.
1281
+ */
1287
1282
  setup_intent_id?: string | null;
1288
1283
  };
1289
1284
  /** @description Decoded JWT payload for render token responses. */
@@ -1296,7 +1291,13 @@ export interface components {
1296
1291
  render_template_id?: string;
1297
1292
  };
1298
1293
  EmbedToken: {
1299
- /** @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
+ */
1300
1301
  token?: string;
1301
1302
  ttl?: number;
1302
1303
  };
@@ -1326,6 +1327,8 @@ export interface components {
1326
1327
  routing_number?: string;
1327
1328
  state?: string;
1328
1329
  token?: string;
1330
+ /** @description True when the bank account was verified via Plaid Auth. */
1331
+ verified?: boolean;
1329
1332
  /** Format: date-time */
1330
1333
  created_at?: string;
1331
1334
  /** Format: date-time */
@@ -1519,12 +1522,9 @@ export interface components {
1519
1522
  /** Format: date-time */
1520
1523
  updated_at?: string;
1521
1524
  };
1522
- /** @enum {string} */
1523
- DunningConfigurationExhaustedActionType: "cancel" | "pause" | "none";
1524
1525
  CreateDunningConfigurationInput: {
1525
1526
  /** @description Days after a failed collection to retry, in ascending order. */
1526
1527
  retry_days: number[];
1527
- exhausted_action?: components["schemas"]["DunningConfigurationExhaustedActionType"];
1528
1528
  enabled?: boolean;
1529
1529
  };
1530
1530
  CreateDunningConfigurationRequest: {
@@ -1532,7 +1532,6 @@ export interface components {
1532
1532
  };
1533
1533
  UpdateDunningConfigurationInput: {
1534
1534
  retry_days?: number[];
1535
- exhausted_action?: components["schemas"]["DunningConfigurationExhaustedActionType"];
1536
1535
  enabled?: boolean;
1537
1536
  };
1538
1537
  UpdateDunningConfigurationRequest: {
@@ -1542,7 +1541,6 @@ export interface components {
1542
1541
  /** Format: uuid */
1543
1542
  id?: string;
1544
1543
  retry_days?: number[];
1545
- exhausted_action?: components["schemas"]["DunningConfigurationExhaustedActionType"];
1546
1544
  enabled?: boolean;
1547
1545
  /** Format: date-time */
1548
1546
  created_at?: string;
@@ -2454,6 +2452,14 @@ export interface components {
2454
2452
  CreateRenderTemplateRequest: {
2455
2453
  render_template: components["schemas"]["CreateRenderTemplateInput"];
2456
2454
  };
2455
+ /** @description Replaces the origin allowlist on an existing render template. Currency, allowed payment methods, and billing address options are not updatable. */
2456
+ UpdateRenderTemplateInput: {
2457
+ /** @description Origin IDs in the current organization. Replaces the current list. At least one origin is required. */
2458
+ origin_ids: string[];
2459
+ };
2460
+ UpdateRenderTemplateRequest: {
2461
+ render_template: components["schemas"]["UpdateRenderTemplateInput"];
2462
+ };
2457
2463
  RenderTemplate: {
2458
2464
  /** Format: uuid */
2459
2465
  id?: string;
@@ -2467,7 +2473,10 @@ export interface components {
2467
2473
  origins: components["schemas"]["Origin"][];
2468
2474
  };
2469
2475
  CreateSetupIntentInput: {
2470
- /** Format: uuid */
2476
+ /**
2477
+ * Format: uuid
2478
+ * @description Customer on the authenticated organization.
2479
+ */
2471
2480
  customer_id?: string;
2472
2481
  metadata?: components["schemas"]["Metadata"];
2473
2482
  };
@@ -2488,8 +2497,16 @@ export interface components {
2488
2497
  SetupIntent: {
2489
2498
  /** Format: uuid */
2490
2499
  id?: string;
2491
- /** Format: uuid */
2492
- 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;
2493
2510
  /** Format: uuid */
2494
2511
  customer_id?: string;
2495
2512
  metadata?: components["schemas"]["Metadata"];
@@ -2979,6 +2996,15 @@ export interface operations {
2979
2996
  };
2980
2997
  };
2981
2998
  responses: {
2999
+ /** @description Existing customer returned */
3000
+ 200: {
3001
+ headers: {
3002
+ [name: string]: unknown;
3003
+ };
3004
+ content: {
3005
+ "application/json": components["schemas"]["Customer"];
3006
+ };
3007
+ };
2982
3008
  /** @description Customer created successfully */
2983
3009
  201: {
2984
3010
  headers: {
@@ -2988,6 +3014,18 @@ export interface operations {
2988
3014
  "application/json": components["schemas"]["Customer"];
2989
3015
  };
2990
3016
  };
3017
+ /**
3018
+ * @description Email and phone match different customers, or the email is new and
3019
+ * the phone already belongs to another customer.
3020
+ */
3021
+ 409: {
3022
+ headers: {
3023
+ [name: string]: unknown;
3024
+ };
3025
+ content: {
3026
+ "application/json": components["schemas"]["Error"];
3027
+ };
3028
+ };
2991
3029
  /** @description Unprocessable entity */
2992
3030
  422: {
2993
3031
  headers: {
@@ -4025,51 +4063,6 @@ export interface operations {
4025
4063
  };
4026
4064
  };
4027
4065
  };
4028
- ConfirmEmbedPaymentIntentWithPaymentMethod: {
4029
- parameters: {
4030
- query?: never;
4031
- header?: never;
4032
- path: {
4033
- /** @description The ID of the payment intent to confirm */
4034
- id: string;
4035
- };
4036
- cookie?: never;
4037
- };
4038
- requestBody: {
4039
- content: {
4040
- "application/json": components["schemas"]["ConfirmPaymentIntentWithPaymentMethodRequest"];
4041
- };
4042
- };
4043
- responses: {
4044
- /** @description Confirmation accepted; authorization or sale continues asynchronously */
4045
- 202: {
4046
- headers: {
4047
- [name: string]: unknown;
4048
- };
4049
- content: {
4050
- "application/json": components["schemas"]["PaymentIntent"];
4051
- };
4052
- };
4053
- /** @description Forbidden */
4054
- 403: {
4055
- headers: {
4056
- [name: string]: unknown;
4057
- };
4058
- content: {
4059
- "application/json": components["schemas"]["Error"];
4060
- };
4061
- };
4062
- /** @description Unprocessable content */
4063
- 422: {
4064
- headers: {
4065
- [name: string]: unknown;
4066
- };
4067
- content: {
4068
- "application/json": components["schemas"]["Error"];
4069
- };
4070
- };
4071
- };
4072
- };
4073
4066
  ListPaymentIntents: {
4074
4067
  parameters: {
4075
4068
  query?: {
@@ -4900,24 +4893,38 @@ export interface operations {
4900
4893
  };
4901
4894
  };
4902
4895
  };
4903
- CreateRenderToken: {
4896
+ UpdateRenderTemplate: {
4904
4897
  parameters: {
4905
4898
  query?: never;
4906
4899
  header?: never;
4907
4900
  path: {
4901
+ /** @description The ID of the render template to update */
4908
4902
  id: string;
4909
4903
  };
4910
4904
  cookie?: never;
4911
4905
  };
4912
- requestBody?: never;
4906
+ requestBody: {
4907
+ content: {
4908
+ "application/json": components["schemas"]["UpdateRenderTemplateRequest"];
4909
+ };
4910
+ };
4913
4911
  responses: {
4914
- /** @description A render token for the render template */
4915
- 201: {
4912
+ /** @description Render template updated successfully */
4913
+ 200: {
4916
4914
  headers: {
4917
4915
  [name: string]: unknown;
4918
4916
  };
4919
4917
  content: {
4920
- "application/json": components["schemas"]["RenderToken"];
4918
+ "application/json": components["schemas"]["RenderTemplate"];
4919
+ };
4920
+ };
4921
+ /** @description Render template not found */
4922
+ 404: {
4923
+ headers: {
4924
+ [name: string]: unknown;
4925
+ };
4926
+ content: {
4927
+ "application/json": components["schemas"]["Error"];
4921
4928
  };
4922
4929
  };
4923
4930
  /** @description Unprocessable entity */
@@ -4931,46 +4938,50 @@ export interface operations {
4931
4938
  };
4932
4939
  };
4933
4940
  };
4934
- GetSetupIntent: {
4941
+ CreateRenderToken: {
4935
4942
  parameters: {
4936
4943
  query?: never;
4937
4944
  header?: never;
4938
4945
  path: {
4939
- /** @description The ID of the setup intent to retrieve */
4940
4946
  id: string;
4941
4947
  };
4942
4948
  cookie?: never;
4943
4949
  };
4944
4950
  requestBody?: never;
4945
4951
  responses: {
4946
- /** @description Successful retrieval of setup intent */
4947
- 200: {
4952
+ /** @description A render token for the render template */
4953
+ 201: {
4948
4954
  headers: {
4949
4955
  [name: string]: unknown;
4950
4956
  };
4951
4957
  content: {
4952
- "application/json": components["schemas"]["SetupIntent"];
4958
+ "application/json": components["schemas"]["RenderToken"];
4959
+ };
4960
+ };
4961
+ /** @description Unprocessable entity */
4962
+ 422: {
4963
+ headers: {
4964
+ [name: string]: unknown;
4965
+ };
4966
+ content: {
4967
+ "application/json": components["schemas"]["Error"];
4953
4968
  };
4954
4969
  };
4955
4970
  };
4956
4971
  };
4957
- ConfirmEmbedSetupIntent: {
4972
+ GetSetupIntent: {
4958
4973
  parameters: {
4959
4974
  query?: never;
4960
4975
  header?: never;
4961
4976
  path: {
4962
- /** @description The ID of the setup intent to confirm */
4977
+ /** @description The ID of the setup intent to retrieve */
4963
4978
  id: string;
4964
4979
  };
4965
4980
  cookie?: never;
4966
4981
  };
4967
- requestBody: {
4968
- content: {
4969
- "application/json": components["schemas"]["ConfirmSetupIntentWithPaymentMethodRequest"];
4970
- };
4971
- };
4982
+ requestBody?: never;
4972
4983
  responses: {
4973
- /** @description Confirmation completed after verification succeeded or failed */
4984
+ /** @description Successful retrieval of setup intent */
4974
4985
  200: {
4975
4986
  headers: {
4976
4987
  [name: string]: unknown;
@@ -4979,27 +4990,9 @@ export interface operations {
4979
4990
  "application/json": components["schemas"]["SetupIntent"];
4980
4991
  };
4981
4992
  };
4982
- /** @description Forbidden */
4983
- 403: {
4984
- headers: {
4985
- [name: string]: unknown;
4986
- };
4987
- content: {
4988
- "application/json": components["schemas"]["Error"];
4989
- };
4990
- };
4991
- /** @description Unprocessable content */
4992
- 422: {
4993
- headers: {
4994
- [name: string]: unknown;
4995
- };
4996
- content: {
4997
- "application/json": components["schemas"]["Error"];
4998
- };
4999
- };
5000
4993
  };
5001
4994
  };
5002
- ConfirmSetupIntentWithPaymentMethod: {
4995
+ ConfirmEmbedSetupIntent: {
5003
4996
  parameters: {
5004
4997
  query?: never;
5005
4998
  header?: never;
@@ -5015,8 +5008,8 @@ export interface operations {
5015
5008
  };
5016
5009
  };
5017
5010
  responses: {
5018
- /** @description Confirmation accepted; card verification continues asynchronously */
5019
- 202: {
5011
+ /** @description Confirmation completed after verification succeeded or failed */
5012
+ 200: {
5020
5013
  headers: {
5021
5014
  [name: string]: unknown;
5022
5015
  };
@@ -5710,7 +5703,6 @@ export const bankAccountProfileFailure_reasonValues: ReadonlyArray<FlattenedDeep
5710
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"];
5711
5704
  export const chargeAllowed_reverse_actionValues: ReadonlyArray<FlattenedDeepRequired<components>["schemas"]["Charge"]["allowed_reverse_action"]> = ["void", "refund"];
5712
5705
  export const chargeStateValues: ReadonlyArray<FlattenedDeepRequired<components>["schemas"]["Charge"]["state"]> = ["cancelled", "errored", "failed", "processing", "requires_capture", "requires_confirmation", "requires_review", "settlement_failed", "succeeded"];
5713
- export const dunningConfigurationExhaustedActionTypeValues: ReadonlyArray<FlattenedDeepRequired<components>["schemas"]["DunningConfigurationExhaustedActionType"]> = ["cancel", "pause", "none"];
5714
5706
  export const externalAccountTypeValues: ReadonlyArray<FlattenedDeepRequired<components>["schemas"]["ExternalAccount"]["type"]> = ["external_card", "external_bank_account"];
5715
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"];
5716
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.59",
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",