@shipengine/js-api 3.2.0 → 3.4.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.
@@ -1,18 +1,28 @@
1
1
  export type AddressResidentialIndicator = "yes" | "no" | "unknown";
2
+ /**
3
+ * @category Entities
4
+ */
5
+ export interface ShippingAddress extends Address {
6
+ instructions?: string | null;
7
+ }
8
+ /**
9
+ * @category Entities
10
+ */
11
+ export interface ShippingAddressTo extends ShippingAddress {
12
+ geolocation?: AddressGeolocation[] | null;
13
+ }
2
14
  /**
3
15
  * @category Entities
4
16
  */
5
17
  export interface Address {
6
18
  addressLine1: string;
7
- addressLine2?: string;
8
- addressLine3?: string;
19
+ addressLine2?: string | null;
20
+ addressLine3?: string | null;
9
21
  addressResidentialIndicator?: AddressResidentialIndicator;
10
22
  cityLocality: string;
11
23
  companyName?: string;
12
24
  countryCode: string;
13
25
  email?: string;
14
- geolocation?: AddressGeolocation[];
15
- instructions?: string;
16
26
  name: string;
17
27
  phone: string;
18
28
  postalCode: string;
package/client.d.ts CHANGED
@@ -8,6 +8,7 @@ import { CustomPackagesAPI } from "./custom-packages";
8
8
  import { CodedError } from "./errors";
9
9
  import { FundingSourcesAPI } from "./funding-sources";
10
10
  import { InsuranceAPI } from "./insurance";
11
+ import { InvoiceAddressAPI } from "./invoice-address";
11
12
  import { LabelsAPI } from "./labels";
12
13
  import { OrderSourcesAPI } from "./order-sources";
13
14
  import { RateCardsAPI } from "./rate-cards";
@@ -143,6 +144,13 @@ export declare class ShipEngineAPI {
143
144
  * @see {@link InsuranceAPI | The Insurance API module}
144
145
  */
145
146
  get insurance(): InsuranceAPI;
147
+ /**
148
+ * The `invoiceAddress` method provides access to the Invoice Address endpoints
149
+ * in ShipEngine API.
150
+ *
151
+ * @see {@link InvoiceAddress | The Invoice Address API module}
152
+ */
153
+ get invoiceAddress(): InvoiceAddressAPI;
146
154
  /**
147
155
  * The `labels` method provides access to the Label endpoints in ShipEngine API.
148
156
  * e.g. Create Label, Get Label, Void Label, etc.
@@ -64,7 +64,7 @@ export interface CarrierRegistration {
64
64
  /** @internal */
65
65
  export interface FundingSourceAddress {
66
66
  addressLine1: string;
67
- addressLine2?: string;
67
+ addressLine2?: string | null;
68
68
  cityLocality: string;
69
69
  company?: string;
70
70
  countryCode: string;
package/index.d.ts CHANGED
@@ -9,6 +9,7 @@ export * from "./dimensions";
9
9
  export * from "./errors";
10
10
  export * from "./funding-sources";
11
11
  export * from "./insurance";
12
+ export * from "./invoice-address";
12
13
  export * from "./labels";
13
14
  export * from "./order-sources";
14
15
  export * from "./payments";
package/index.js CHANGED
@@ -975,7 +975,7 @@ var ipaddr = {
975
975
  }).call(commonjsGlobal);
976
976
  } (ipaddr));
977
977
 
978
- var __async$6 = (__this, __arguments, generator) => {
978
+ var __async$7 = (__this, __arguments, generator) => {
979
979
  return new Promise((resolve, reject) => {
980
980
  var fulfilled = (value) => {
981
981
  try {
@@ -995,7 +995,7 @@ var __async$6 = (__this, __arguments, generator) => {
995
995
  step((generator = generator.apply(__this, __arguments)).next());
996
996
  });
997
997
  };
998
- const getEndUserIpAddress = () => __async$6(void 0, null, function* () {
998
+ const getEndUserIpAddress = () => __async$7(void 0, null, function* () {
999
999
  try {
1000
1000
  const response = yield axios.get("https://api.ipify.org/?format=json");
1001
1001
  if (response.data.ip && ipaddrExports.isValid(response.data.ip)) {
@@ -1069,7 +1069,7 @@ var __objRest$1 = (source, exclude) => {
1069
1069
  }
1070
1070
  return target;
1071
1071
  };
1072
- var __async$5 = (__this, __arguments, generator) => {
1072
+ var __async$6 = (__this, __arguments, generator) => {
1073
1073
  return new Promise((resolve, reject) => {
1074
1074
  var fulfilled = (value) => {
1075
1075
  try {
@@ -1109,7 +1109,7 @@ class CarriersAPI {
1109
1109
  /**
1110
1110
  * The `connect` method connects a carrier account to a user's ShipEngine account.
1111
1111
  */
1112
- this.connect = (_a) => __async$5(this, null, function* () {
1112
+ this.connect = (_a) => __async$6(this, null, function* () {
1113
1113
  var _b = _a, { carrierCode } = _b, connection = __objRest$1(_b, ["carrierCode"]);
1114
1114
  const endUserIpAddress = yield getEndUserIpAddress();
1115
1115
  if (!endUserIpAddress)
@@ -1200,7 +1200,7 @@ class CarriersAPI {
1200
1200
  }
1201
1201
  }
1202
1202
 
1203
- var __async$4 = (__this, __arguments, generator) => {
1203
+ var __async$5 = (__this, __arguments, generator) => {
1204
1204
  return new Promise((resolve, reject) => {
1205
1205
  var fulfilled = (value) => {
1206
1206
  try {
@@ -1242,7 +1242,7 @@ class ConnectionsAPI {
1242
1242
  /**
1243
1243
  * The `connectCarrier` method connects a carrier to account.
1244
1244
  */
1245
- this.connectCarrier = (carrierName, formData) => __async$4(this, null, function* () {
1245
+ this.connectCarrier = (carrierName, formData) => __async$5(this, null, function* () {
1246
1246
  return yield this.client.post(
1247
1247
  `/v1/connections/carriers/${carrierName}`,
1248
1248
  formData,
@@ -3433,7 +3433,7 @@ var __spreadValues$3 = (a, b) => {
3433
3433
  }
3434
3434
  return a;
3435
3435
  };
3436
- var __async$3 = (__this, __arguments, generator) => {
3436
+ var __async$4 = (__this, __arguments, generator) => {
3437
3437
  return new Promise((resolve, reject) => {
3438
3438
  var fulfilled = (value) => {
3439
3439
  try {
@@ -3472,7 +3472,7 @@ class FundingSourcesAPI {
3472
3472
  * The `create` method creates a new funding source for a given user. This requires
3473
3473
  * payment information to be collected from the user.
3474
3474
  */
3475
- this.create = (createFundingSource) => __async$3(this, null, function* () {
3475
+ this.create = (createFundingSource) => __async$4(this, null, function* () {
3476
3476
  const endUserIpAddress = yield getEndUserIpAddress();
3477
3477
  if (!endUserIpAddress) {
3478
3478
  return Promise.reject([new CodedError("Unable to get IP address")]);
@@ -3486,7 +3486,7 @@ class FundingSourcesAPI {
3486
3486
  * user to update the billing address or payment information associated with the
3487
3487
  * funding source.
3488
3488
  */
3489
- this.update = (billingInfo, creditCardInfo, fundingSourceId) => __async$3(this, null, function* () {
3489
+ this.update = (billingInfo, creditCardInfo, fundingSourceId) => __async$4(this, null, function* () {
3490
3490
  const endUserIpAddress = yield getEndUserIpAddress();
3491
3491
  if (!endUserIpAddress) {
3492
3492
  return Promise.reject([new CodedError("Unable to get IP address")]);
@@ -3504,7 +3504,7 @@ class FundingSourcesAPI {
3504
3504
  * The `registerCarrier` method registers a carrier account and associates
3505
3505
  * it with a given funding source.
3506
3506
  */
3507
- this.registerCarrier = (carrier) => __async$3(this, null, function* () {
3507
+ this.registerCarrier = (carrier) => __async$4(this, null, function* () {
3508
3508
  const endUserIpAddress = yield getEndUserIpAddress();
3509
3509
  if (!endUserIpAddress) {
3510
3510
  return Promise.reject([new CodedError("Unable to get IP address")]);
@@ -3516,7 +3516,7 @@ class FundingSourcesAPI {
3516
3516
  /**
3517
3517
  * The `addFunds` method allows you to add funds to a funding source.
3518
3518
  */
3519
- this.addFunds = (amount, fundingSourceId) => __async$3(this, null, function* () {
3519
+ this.addFunds = (amount, fundingSourceId) => __async$4(this, null, function* () {
3520
3520
  return yield this.client.put(
3521
3521
  `/v1/funding_sources/${fundingSourceId}/add_funds`,
3522
3522
  amount
@@ -3526,7 +3526,7 @@ class FundingSourcesAPI {
3526
3526
  * The `metadata` method returns seller-specific requirements for creating funding sources
3527
3527
  * and attaching carriers
3528
3528
  */
3529
- this.metadata = () => __async$3(this, null, function* () {
3529
+ this.metadata = () => __async$4(this, null, function* () {
3530
3530
  return yield this.client.get("/v1/funding_sources/metadata");
3531
3531
  });
3532
3532
  /**
@@ -3578,6 +3578,51 @@ class InsuranceAPI {
3578
3578
  }
3579
3579
  }
3580
3580
 
3581
+ var __async$3 = (__this, __arguments, generator) => {
3582
+ return new Promise((resolve, reject) => {
3583
+ var fulfilled = (value) => {
3584
+ try {
3585
+ step(generator.next(value));
3586
+ } catch (e) {
3587
+ reject(e);
3588
+ }
3589
+ };
3590
+ var rejected = (value) => {
3591
+ try {
3592
+ step(generator.throw(value));
3593
+ } catch (e) {
3594
+ reject(e);
3595
+ }
3596
+ };
3597
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
3598
+ step((generator = generator.apply(__this, __arguments)).next());
3599
+ });
3600
+ };
3601
+ class InvoiceAddressAPI {
3602
+ constructor(client) {
3603
+ this.client = client;
3604
+ /**
3605
+ * The `get` method retrieves the invoice address for a given user.
3606
+ */
3607
+ this.get = () => {
3608
+ return this.client.get("/v1/invoice_address");
3609
+ };
3610
+ /**
3611
+ * The `create` method creates a new invoice address for a given user.
3612
+ */
3613
+ this.create = (invoiceAddress) => __async$3(this, null, function* () {
3614
+ return yield this.client.post("/v1/invoice_address", invoiceAddress);
3615
+ });
3616
+ /**
3617
+ * The `update` method updates a invoice address for a given user.
3618
+ */
3619
+ this.update = (invoiceAddress) => __async$3(this, null, function* () {
3620
+ return yield this.client.put("/v1/invoice_address", invoiceAddress);
3621
+ });
3622
+ this.client = client;
3623
+ }
3624
+ }
3625
+
3581
3626
  class LabelsAPI {
3582
3627
  constructor(client) {
3583
3628
  this.client = client;
@@ -3790,10 +3835,14 @@ class SalesOrderShipmentsAPI {
3790
3835
  /**
3791
3836
  * The `list` method retrieves a list of sales order shipments for a given user.
3792
3837
  */
3793
- this.list = (body = {}, params) => {
3794
- return this.client.post("/v-beta/shipments/list", body, {
3795
- params
3796
- });
3838
+ this.list = (body) => {
3839
+ return this.client.post("/v-beta/shipments/list", body);
3840
+ };
3841
+ /**
3842
+ * The `listShipmentsByExternalOrderId` method retrieves a list of shipments associated to a sales order that matches `externalOrderId`
3843
+ */
3844
+ this.listShipmentsByExternalOrderId = (externalOrderId) => {
3845
+ return this.client.get(`/v-beta/shipments/external_order_id/${externalOrderId}`);
3797
3846
  };
3798
3847
  /**
3799
3848
  * The `get` method retrieves a specific sales order shipment by `shipmentId`.
@@ -3835,6 +3884,13 @@ class SalesOrdersAPI {
3835
3884
  this.get = (salesOrderId) => {
3836
3885
  return this.client.get(`/v-beta/sales_orders/${salesOrderId}`);
3837
3886
  };
3887
+ /**
3888
+ * The `getByExternalId` method retrieves a specific sales order by its `externalOrderId`.
3889
+ * @param externalOrderId Id that matches that of the desired sales order.
3890
+ */
3891
+ this.getByExternalId = (externalOrderId) => {
3892
+ return this.client.get(`/v-beta/sales_orders/external_order_id/${externalOrderId}`);
3893
+ };
3838
3894
  /**
3839
3895
  * The `notifyShipped` method notifies order source that the order has been
3840
3896
  * shipped. Typically, the order source will then notify the user based on
@@ -21701,6 +21757,15 @@ class ShipEngineAPI {
21701
21757
  get insurance() {
21702
21758
  return new InsuranceAPI(this.client);
21703
21759
  }
21760
+ /**
21761
+ * The `invoiceAddress` method provides access to the Invoice Address endpoints
21762
+ * in ShipEngine API.
21763
+ *
21764
+ * @see {@link InvoiceAddress | The Invoice Address API module}
21765
+ */
21766
+ get invoiceAddress() {
21767
+ return new InvoiceAddressAPI(this.client);
21768
+ }
21704
21769
  /**
21705
21770
  * The `labels` method provides access to the Label endpoints in ShipEngine API.
21706
21771
  * e.g. Create Label, Get Label, Void Label, etc.
@@ -21830,6 +21895,7 @@ exports.CustomsNonDeliveryType = CustomsNonDeliveryType;
21830
21895
  exports.FundingSourcesAPI = FundingSourcesAPI;
21831
21896
  exports.InsuranceAPI = InsuranceAPI;
21832
21897
  exports.InsuranceProviderType = InsuranceProviderType;
21898
+ exports.InvoiceAddressAPI = InvoiceAddressAPI;
21833
21899
  exports.LabelsAPI = LabelsAPI;
21834
21900
  exports.MetadataCapability = MetadataCapability;
21835
21901
  exports.MetadataRequirement = MetadataRequirement;
package/index.mjs CHANGED
@@ -971,7 +971,7 @@ var ipaddr = {
971
971
  }).call(commonjsGlobal);
972
972
  } (ipaddr));
973
973
 
974
- var __async$6 = (__this, __arguments, generator) => {
974
+ var __async$7 = (__this, __arguments, generator) => {
975
975
  return new Promise((resolve, reject) => {
976
976
  var fulfilled = (value) => {
977
977
  try {
@@ -991,7 +991,7 @@ var __async$6 = (__this, __arguments, generator) => {
991
991
  step((generator = generator.apply(__this, __arguments)).next());
992
992
  });
993
993
  };
994
- const getEndUserIpAddress = () => __async$6(void 0, null, function* () {
994
+ const getEndUserIpAddress = () => __async$7(void 0, null, function* () {
995
995
  try {
996
996
  const response = yield axios.get("https://api.ipify.org/?format=json");
997
997
  if (response.data.ip && ipaddrExports.isValid(response.data.ip)) {
@@ -1065,7 +1065,7 @@ var __objRest$1 = (source, exclude) => {
1065
1065
  }
1066
1066
  return target;
1067
1067
  };
1068
- var __async$5 = (__this, __arguments, generator) => {
1068
+ var __async$6 = (__this, __arguments, generator) => {
1069
1069
  return new Promise((resolve, reject) => {
1070
1070
  var fulfilled = (value) => {
1071
1071
  try {
@@ -1105,7 +1105,7 @@ class CarriersAPI {
1105
1105
  /**
1106
1106
  * The `connect` method connects a carrier account to a user's ShipEngine account.
1107
1107
  */
1108
- this.connect = (_a) => __async$5(this, null, function* () {
1108
+ this.connect = (_a) => __async$6(this, null, function* () {
1109
1109
  var _b = _a, { carrierCode } = _b, connection = __objRest$1(_b, ["carrierCode"]);
1110
1110
  const endUserIpAddress = yield getEndUserIpAddress();
1111
1111
  if (!endUserIpAddress)
@@ -1196,7 +1196,7 @@ class CarriersAPI {
1196
1196
  }
1197
1197
  }
1198
1198
 
1199
- var __async$4 = (__this, __arguments, generator) => {
1199
+ var __async$5 = (__this, __arguments, generator) => {
1200
1200
  return new Promise((resolve, reject) => {
1201
1201
  var fulfilled = (value) => {
1202
1202
  try {
@@ -1238,7 +1238,7 @@ class ConnectionsAPI {
1238
1238
  /**
1239
1239
  * The `connectCarrier` method connects a carrier to account.
1240
1240
  */
1241
- this.connectCarrier = (carrierName, formData) => __async$4(this, null, function* () {
1241
+ this.connectCarrier = (carrierName, formData) => __async$5(this, null, function* () {
1242
1242
  return yield this.client.post(
1243
1243
  `/v1/connections/carriers/${carrierName}`,
1244
1244
  formData,
@@ -3429,7 +3429,7 @@ var __spreadValues$3 = (a, b) => {
3429
3429
  }
3430
3430
  return a;
3431
3431
  };
3432
- var __async$3 = (__this, __arguments, generator) => {
3432
+ var __async$4 = (__this, __arguments, generator) => {
3433
3433
  return new Promise((resolve, reject) => {
3434
3434
  var fulfilled = (value) => {
3435
3435
  try {
@@ -3468,7 +3468,7 @@ class FundingSourcesAPI {
3468
3468
  * The `create` method creates a new funding source for a given user. This requires
3469
3469
  * payment information to be collected from the user.
3470
3470
  */
3471
- this.create = (createFundingSource) => __async$3(this, null, function* () {
3471
+ this.create = (createFundingSource) => __async$4(this, null, function* () {
3472
3472
  const endUserIpAddress = yield getEndUserIpAddress();
3473
3473
  if (!endUserIpAddress) {
3474
3474
  return Promise.reject([new CodedError("Unable to get IP address")]);
@@ -3482,7 +3482,7 @@ class FundingSourcesAPI {
3482
3482
  * user to update the billing address or payment information associated with the
3483
3483
  * funding source.
3484
3484
  */
3485
- this.update = (billingInfo, creditCardInfo, fundingSourceId) => __async$3(this, null, function* () {
3485
+ this.update = (billingInfo, creditCardInfo, fundingSourceId) => __async$4(this, null, function* () {
3486
3486
  const endUserIpAddress = yield getEndUserIpAddress();
3487
3487
  if (!endUserIpAddress) {
3488
3488
  return Promise.reject([new CodedError("Unable to get IP address")]);
@@ -3500,7 +3500,7 @@ class FundingSourcesAPI {
3500
3500
  * The `registerCarrier` method registers a carrier account and associates
3501
3501
  * it with a given funding source.
3502
3502
  */
3503
- this.registerCarrier = (carrier) => __async$3(this, null, function* () {
3503
+ this.registerCarrier = (carrier) => __async$4(this, null, function* () {
3504
3504
  const endUserIpAddress = yield getEndUserIpAddress();
3505
3505
  if (!endUserIpAddress) {
3506
3506
  return Promise.reject([new CodedError("Unable to get IP address")]);
@@ -3512,7 +3512,7 @@ class FundingSourcesAPI {
3512
3512
  /**
3513
3513
  * The `addFunds` method allows you to add funds to a funding source.
3514
3514
  */
3515
- this.addFunds = (amount, fundingSourceId) => __async$3(this, null, function* () {
3515
+ this.addFunds = (amount, fundingSourceId) => __async$4(this, null, function* () {
3516
3516
  return yield this.client.put(
3517
3517
  `/v1/funding_sources/${fundingSourceId}/add_funds`,
3518
3518
  amount
@@ -3522,7 +3522,7 @@ class FundingSourcesAPI {
3522
3522
  * The `metadata` method returns seller-specific requirements for creating funding sources
3523
3523
  * and attaching carriers
3524
3524
  */
3525
- this.metadata = () => __async$3(this, null, function* () {
3525
+ this.metadata = () => __async$4(this, null, function* () {
3526
3526
  return yield this.client.get("/v1/funding_sources/metadata");
3527
3527
  });
3528
3528
  /**
@@ -3574,6 +3574,51 @@ class InsuranceAPI {
3574
3574
  }
3575
3575
  }
3576
3576
 
3577
+ var __async$3 = (__this, __arguments, generator) => {
3578
+ return new Promise((resolve, reject) => {
3579
+ var fulfilled = (value) => {
3580
+ try {
3581
+ step(generator.next(value));
3582
+ } catch (e) {
3583
+ reject(e);
3584
+ }
3585
+ };
3586
+ var rejected = (value) => {
3587
+ try {
3588
+ step(generator.throw(value));
3589
+ } catch (e) {
3590
+ reject(e);
3591
+ }
3592
+ };
3593
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
3594
+ step((generator = generator.apply(__this, __arguments)).next());
3595
+ });
3596
+ };
3597
+ class InvoiceAddressAPI {
3598
+ constructor(client) {
3599
+ this.client = client;
3600
+ /**
3601
+ * The `get` method retrieves the invoice address for a given user.
3602
+ */
3603
+ this.get = () => {
3604
+ return this.client.get("/v1/invoice_address");
3605
+ };
3606
+ /**
3607
+ * The `create` method creates a new invoice address for a given user.
3608
+ */
3609
+ this.create = (invoiceAddress) => __async$3(this, null, function* () {
3610
+ return yield this.client.post("/v1/invoice_address", invoiceAddress);
3611
+ });
3612
+ /**
3613
+ * The `update` method updates a invoice address for a given user.
3614
+ */
3615
+ this.update = (invoiceAddress) => __async$3(this, null, function* () {
3616
+ return yield this.client.put("/v1/invoice_address", invoiceAddress);
3617
+ });
3618
+ this.client = client;
3619
+ }
3620
+ }
3621
+
3577
3622
  class LabelsAPI {
3578
3623
  constructor(client) {
3579
3624
  this.client = client;
@@ -3786,10 +3831,14 @@ class SalesOrderShipmentsAPI {
3786
3831
  /**
3787
3832
  * The `list` method retrieves a list of sales order shipments for a given user.
3788
3833
  */
3789
- this.list = (body = {}, params) => {
3790
- return this.client.post("/v-beta/shipments/list", body, {
3791
- params
3792
- });
3834
+ this.list = (body) => {
3835
+ return this.client.post("/v-beta/shipments/list", body);
3836
+ };
3837
+ /**
3838
+ * The `listShipmentsByExternalOrderId` method retrieves a list of shipments associated to a sales order that matches `externalOrderId`
3839
+ */
3840
+ this.listShipmentsByExternalOrderId = (externalOrderId) => {
3841
+ return this.client.get(`/v-beta/shipments/external_order_id/${externalOrderId}`);
3793
3842
  };
3794
3843
  /**
3795
3844
  * The `get` method retrieves a specific sales order shipment by `shipmentId`.
@@ -3831,6 +3880,13 @@ class SalesOrdersAPI {
3831
3880
  this.get = (salesOrderId) => {
3832
3881
  return this.client.get(`/v-beta/sales_orders/${salesOrderId}`);
3833
3882
  };
3883
+ /**
3884
+ * The `getByExternalId` method retrieves a specific sales order by its `externalOrderId`.
3885
+ * @param externalOrderId Id that matches that of the desired sales order.
3886
+ */
3887
+ this.getByExternalId = (externalOrderId) => {
3888
+ return this.client.get(`/v-beta/sales_orders/external_order_id/${externalOrderId}`);
3889
+ };
3834
3890
  /**
3835
3891
  * The `notifyShipped` method notifies order source that the order has been
3836
3892
  * shipped. Typically, the order source will then notify the user based on
@@ -21697,6 +21753,15 @@ class ShipEngineAPI {
21697
21753
  get insurance() {
21698
21754
  return new InsuranceAPI(this.client);
21699
21755
  }
21756
+ /**
21757
+ * The `invoiceAddress` method provides access to the Invoice Address endpoints
21758
+ * in ShipEngine API.
21759
+ *
21760
+ * @see {@link InvoiceAddress | The Invoice Address API module}
21761
+ */
21762
+ get invoiceAddress() {
21763
+ return new InvoiceAddressAPI(this.client);
21764
+ }
21700
21765
  /**
21701
21766
  * The `labels` method provides access to the Label endpoints in ShipEngine API.
21702
21767
  * e.g. Create Label, Get Label, Void Label, etc.
@@ -21812,4 +21877,4 @@ class ShipEngineAPI {
21812
21877
  }
21813
21878
  }
21814
21879
 
21815
- export { AccountSettingsAPI, AddressesAPI, CarriersAPI, CodedError, ConfirmationType, ConnectionsAPI, CreditCardVendor, Currency, CustomPackagesAPI, CustomsContentsType, CustomsNonDeliveryType, FundingSourcesAPI, InsuranceAPI, InsuranceProviderType, LabelsAPI, MetadataCapability, MetadataRequirement, MetadataSatisfyingFormTypes, MovementIndicator, OrderSourcesAPI, RateCardStatus, RateCardsAPI, RatesAPI, types as SE, SalesOrderShipmentsAPI, SalesOrdersAPI, SellersAPI, ServicePointsAPI, ShipEngineAPI, ShipmentsAPI, ShippingRulesAPI, ThemesAPI, WarehousesAPI, WebhooksAPI, camelizeKeys, decamelizeKeys, getEndUserIpAddress, isCodedError, isCodedErrors, isDataCodedErrors, isInvalidTokenError, parseError };
21880
+ export { AccountSettingsAPI, AddressesAPI, CarriersAPI, CodedError, ConfirmationType, ConnectionsAPI, CreditCardVendor, Currency, CustomPackagesAPI, CustomsContentsType, CustomsNonDeliveryType, FundingSourcesAPI, InsuranceAPI, InsuranceProviderType, InvoiceAddressAPI, LabelsAPI, MetadataCapability, MetadataRequirement, MetadataSatisfyingFormTypes, MovementIndicator, OrderSourcesAPI, RateCardStatus, RateCardsAPI, RatesAPI, types as SE, SalesOrderShipmentsAPI, SalesOrdersAPI, SellersAPI, ServicePointsAPI, ShipEngineAPI, ShipmentsAPI, ShippingRulesAPI, ThemesAPI, WarehousesAPI, WebhooksAPI, camelizeKeys, decamelizeKeys, getEndUserIpAddress, isCodedError, isCodedErrors, isDataCodedErrors, isInvalidTokenError, parseError };
@@ -0,0 +1,22 @@
1
+ import { AxiosInstance } from "axios";
2
+ import { InvoiceAddress } from "./types";
3
+ /**
4
+ * @internal
5
+ * # Invoice Address API module - /v1/invoice_address
6
+ */
7
+ export declare class InvoiceAddressAPI {
8
+ private client;
9
+ constructor(client: AxiosInstance);
10
+ /**
11
+ * The `get` method retrieves the invoice address for a given user.
12
+ */
13
+ get: () => Promise<import("axios").AxiosResponse<InvoiceAddress, any>>;
14
+ /**
15
+ * The `create` method creates a new invoice address for a given user.
16
+ */
17
+ create: (invoiceAddress: InvoiceAddress) => Promise<import("axios").AxiosResponse<InvoiceAddress, any>>;
18
+ /**
19
+ * The `update` method updates a invoice address for a given user.
20
+ */
21
+ update: (invoiceAddress: InvoiceAddress) => Promise<import("axios").AxiosResponse<InvoiceAddress, any>>;
22
+ }
@@ -0,0 +1,2 @@
1
+ export * from "./api";
2
+ export * from "./types";
@@ -0,0 +1,13 @@
1
+ /** @internal */
2
+ export interface InvoiceAddress {
3
+ addressLine1: string;
4
+ addressLine2?: string;
5
+ cityLocality: string;
6
+ company?: string;
7
+ countryCode: string;
8
+ email: string;
9
+ fullName: string;
10
+ phone: string;
11
+ postalCode: string;
12
+ stateProvince: string;
13
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shipengine/js-api",
3
- "version": "3.2.0",
3
+ "version": "3.4.0",
4
4
  "main": "./index.js",
5
5
  "types": "./index.d.ts",
6
6
  "exports": {
@@ -60,15 +60,19 @@ export type ListSalesOrderShipmentsParams = {
60
60
  * # Sales Order Shipments - List Sales Order Shipments Body
61
61
  */
62
62
  export type ListSalesOrderShipmentBody = {
63
+ /**
64
+ * `externalOrderIds` is an array of non-unique external ids that match to a sales order
65
+ */
66
+ externalOrderIds?: string[];
63
67
  /**
64
68
  * `salesOrderIds` is an array of sales order IDs to be used when listing sales
65
69
  * orders.
66
70
  */
67
71
  salesOrderIds?: string[];
68
72
  /**
69
- * `shipments` is an array of shipments associated with the sales orders.
73
+ * `shipmentIds` is an array of shipments associated with the sales orders.
70
74
  */
71
- shipments?: SalesOrderShipment[];
75
+ shipmentIds?: string[];
72
76
  };
73
77
  /**
74
78
  * # Sales Order Shipments - List Sales Order Shipments Result
@@ -88,7 +92,11 @@ export declare class SalesOrderShipmentsAPI {
88
92
  /**
89
93
  * The `list` method retrieves a list of sales order shipments for a given user.
90
94
  */
91
- list: (body?: ListSalesOrderShipmentBody | undefined, params?: ListSalesOrderShipmentsParams) => Promise<import("axios").AxiosResponse<ListSalesOrderShipmentsResult, any>>;
95
+ list: (body: ListSalesOrderShipmentBody) => Promise<import("axios").AxiosResponse<ListSalesOrderShipmentsResult, any>>;
96
+ /**
97
+ * The `listShipmentsByExternalOrderId` method retrieves a list of shipments associated to a sales order that matches `externalOrderId`
98
+ */
99
+ listShipmentsByExternalOrderId: (externalOrderId: string) => Promise<import("axios").AxiosResponse<ListSalesOrderShipmentsResult, any>>;
92
100
  /**
93
101
  * The `get` method retrieves a specific sales order shipment by `shipmentId`.
94
102
  */
@@ -31,6 +31,11 @@ export declare class SalesOrdersAPI {
31
31
  * The `get` method retrieves a specific sales order by `salesOrderId`.
32
32
  */
33
33
  get: (salesOrderId: string) => Promise<import("axios").AxiosResponse<SalesOrder, any>>;
34
+ /**
35
+ * The `getByExternalId` method retrieves a specific sales order by its `externalOrderId`.
36
+ * @param externalOrderId Id that matches that of the desired sales order.
37
+ */
38
+ getByExternalId: (externalOrderId: string) => Promise<import("axios").AxiosResponse<SalesOrder, any>>;
34
39
  /**
35
40
  * The `notifyShipped` method notifies order source that the order has been
36
41
  * shipped. Typically, the order source will then notify the user based on
@@ -1,4 +1,4 @@
1
- import { Address, AddressValidation } from "../addresses";
1
+ import { Address, AddressValidation, ShippingAddress, ShippingAddressTo } from "../addresses";
2
2
  import { CarrierPackage } from "../carriers";
3
3
  import { CodedError } from "../errors";
4
4
  import { OrderSourceCode } from "../order-sources";
@@ -203,36 +203,47 @@ export interface Shipment {
203
203
  useUpsGroundFreightPricing?: boolean;
204
204
  windsorFrameworkDetails?: WindsorFrameworkDetails;
205
205
  };
206
+ amountPaid: Money;
207
+ assignedUser?: string | null;
206
208
  carrierId: string;
207
- comparisonRateType?: string;
209
+ comparisonRateType?: string | null;
208
210
  confirmation: ConfirmationType;
209
211
  createdAt: string;
210
212
  customs?: Customs;
211
- externalOrderId?: string;
212
- externalShipmentId?: string;
213
+ externalOrderId?: string | null;
214
+ externalShipmentId?: string | null;
215
+ holdUntilDate?: string | null;
213
216
  insuranceProvider: InsuranceProviderType;
217
+ isGift?: boolean;
214
218
  isReturn?: boolean;
215
219
  items: ShipmentItem[];
216
220
  modifiedAt: string;
221
+ notesForGift?: string | null;
222
+ notesFromBuyer?: string | null;
217
223
  orderSourceCode: OrderSourceCode | null;
218
224
  originType?: OriginTypes;
219
225
  packages: ShipmentPackage[];
220
- returnTo: Address | null;
226
+ requestedShipmentService?: string | null;
227
+ retailRate?: number | null;
228
+ returnTo: ShippingAddress | null;
221
229
  serviceCode: string | null;
230
+ shipByDate?: string | null;
222
231
  shipDate?: string;
223
- shipFrom: Address | null;
232
+ shipFrom: ShippingAddress;
224
233
  shipmentId: string;
225
234
  shipmentNumber?: string;
226
235
  shipmentStatus: ShipmentStatus;
227
- shippingRuleId?: string;
228
- shipTo: Address;
236
+ shippingPaid: Money;
237
+ shippingRuleId?: string | null;
238
+ shipTo: ShippingAddressTo;
229
239
  tags: {
230
240
  name: string;
231
241
  }[];
232
242
  taxIdentifiers?: TaxIdentifier[];
243
+ taxPaid: Money;
233
244
  totalWeight: WeightWithUnit;
234
245
  validateAddress?: AddressValidationOptions;
235
- warehouseId?: string;
246
+ warehouseId?: string | null;
236
247
  }
237
248
  export type ShipmentRateResponse = {
238
249
  createdAt: string;
package/types.d.ts CHANGED
@@ -9,6 +9,7 @@ export * from "./dimensions/types";
9
9
  export * from "./errors/types";
10
10
  export * from "./funding-sources/types";
11
11
  export * from "./insurance/types";
12
+ export * from "./invoice-address/types";
12
13
  export * from "./labels/types";
13
14
  export * from "./order-sources/types";
14
15
  export * from "./payments/types";