@shipengine/js-api 4.13.0 → 4.14.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.
@@ -20,6 +20,14 @@ export type AccountBillingResponse = {
20
20
  stateProvince: string;
21
21
  };
22
22
  /** @internal */
23
+ type PaymentMethodWithId = {
24
+ paymentMethodId: string;
25
+ };
26
+ /** @internal */
27
+ type PaymentMethodWithSession = {
28
+ sessionId: string;
29
+ };
30
+ /** @internal */
23
31
  export type UpsertAccountBillingRequestBody = {
24
32
  addressLine1: string;
25
33
  addressLine2?: string;
@@ -28,9 +36,13 @@ export type UpsertAccountBillingRequestBody = {
28
36
  countryCode: string;
29
37
  email: string;
30
38
  fullName: string;
31
- paymentMethod: {
32
- sessionId: string;
33
- };
39
+ /**
40
+ * In the request , payment method has to pass either a paymentMethodId or a sessionId
41
+ * Cases:
42
+ * 1. When we want to assign a newly created payment method where you don't yet know the payment method ID -> session ID.
43
+ * 2. If we already know the payment method ID because it was created previously -> payment method ID.
44
+ */
45
+ paymentMethod: PaymentMethodWithId | PaymentMethodWithSession;
34
46
  phone: string;
35
47
  postalCode: string;
36
48
  stateProvince: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shipengine/js-api",
3
- "version": "4.13.0",
3
+ "version": "4.14.0",
4
4
  "main": "./index.js",
5
5
  "types": "./index.d.ts",
6
6
  "exports": {