arky-sdk 0.4.43 → 0.4.47
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/dist/index.cjs +25 -40
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +25 -40
- package/dist/index.js.map +1 -1
- package/dist/types.cjs.map +1 -1
- package/dist/types.d.cts +119 -58
- package/dist/types.d.ts +119 -58
- package/dist/types.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { RequestOptions, MagicLinkVerifyParams, MagicLinkRequestParams, UpdateAccountProfileParams, DeleteAccountParams, AddPhoneNumberParams, PhoneNumberConfirmParams, GetMeParams, SearchAccountsParams, AccountSubscribeParams, CreateBusinessParams, UpdateBusinessParams, DeleteBusinessParams, GetBusinessParams, GetBusinessesParams, GetBusinessParentsParams, TriggerBuildsParams, GetSubscriptionPlansParams, GetSubscriptionParams, SubscribeParams, CreatePortalSessionParams, InviteUserParams, HandleInvitationParams, TestWebhookParams, GetBusinessMediaParams2, ProcessRefundParams, GetBusinessEventsParams, UpdateBusinessEventParams, ConnectStripeParams, DisconnectStripeParams, UploadBusinessMediaParams, DeleteBusinessMediaParams, GetBusinessMediaParams, UpdateMediaParams, TrackEmailOpenParams, GetDeliveryStatsParams, CreatePromoCodeParams, UpdatePromoCodeParams, DeletePromoCodeParams, GetPromoCodeParams, GetPromoCodesParams, CreateNodeParams, UpdateNodeParams, DeleteNodeParams, GetNodeParams, GetNodesParams, GetNodeChildrenParams, GenerateBlocksParams, GetVariableMetadataParams, CreateProductParams, UpdateProductParams, DeleteProductParams, GetProductParams, GetProductsParams, CreateOrderParams, UpdateOrderParams, GetOrderParams, GetOrdersParams, GetQuoteParams, OrderCheckoutParams, Slot, CreateReservationParams, UpdateReservationParams, ReservationCheckoutParams, GetReservationParams, SearchReservationsParams, GetReservationQuoteParams, CreateServiceParams, UpdateServiceParams, DeleteServiceParams, BulkScheduleParams, GetServiceParams, GetServicesParams, CreateProviderParams, UpdateProviderParams, DeleteProviderParams, GetProviderParams, GetProvidersParams, GetBusinessServiceWorkingTimeParams, CreateWorkflowParams, UpdateWorkflowParams, DeleteWorkflowParams, GetWorkflowParams, GetWorkflowsParams, TriggerWorkflowParams, CreateAudienceParams, UpdateAudienceParams, GetAudienceParams, GetAudiencesParams, SubscribeAudienceParams, GetAudienceSubscribersParams, RevokeAudienceSubscriptionParams, GetShippingRatesParams, ShippingRate,
|
|
2
|
-
export { Access, AnalyticsConfig, ApiResponse, Audience, AudienceAccessResponse, AudienceSubscribeResponse, AudienceSubscriber, Block, Business, BusinessConfig, BusinessEvent, BusinessEventAction, BusinessShippingProvider, DayAvailability, EshopCartItem, EshopStoreState, GetAvailabilityParams, GetSlotsForDateParams, Language, Location, Market, Media, MediaResolution, Node, OrderShipping, PaginatedResponse, Parcel, Payment, PaymentMethod, PaymentMethodType, PaymentProviderConfig, PaymentRefund, Price, PromoCodeValidation, ProviderWithTimeline, Quote, ReservationCartItem, ReservationStoreState, ShippingAddress, ShippingMethod, ShippingProviderShippo, ShippingProviderStatus, ShippingStatus, ShippingWeightTier, SystemTemplateKey, Workflow, WorkflowEdge, WorkflowHttpMethod, WorkflowHttpNode, WorkflowIfNode, WorkflowLoopNode, WorkflowNode, WorkflowTriggerNode, WorkflowWaitNode, Zone } from './types.cjs';
|
|
1
|
+
import { RequestOptions, MagicLinkVerifyParams, MagicLinkRequestParams, UpdateAccountProfileParams, DeleteAccountParams, AddPhoneNumberParams, PhoneNumberConfirmParams, GetMeParams, SearchAccountsParams, AccountSubscribeParams, CreateBusinessParams, UpdateBusinessParams, DeleteBusinessParams, GetBusinessParams, GetBusinessesParams, GetBusinessParentsParams, TriggerBuildsParams, GetSubscriptionPlansParams, GetSubscriptionParams, SubscribeParams, CreatePortalSessionParams, InviteUserParams, HandleInvitationParams, TestWebhookParams, GetBusinessMediaParams2, ProcessRefundParams, GetBusinessEventsParams, UpdateBusinessEventParams, ConnectStripeParams, DisconnectStripeParams, UploadBusinessMediaParams, DeleteBusinessMediaParams, GetBusinessMediaParams, UpdateMediaParams, TrackEmailOpenParams, GetDeliveryStatsParams, CreatePromoCodeParams, UpdatePromoCodeParams, DeletePromoCodeParams, GetPromoCodeParams, GetPromoCodesParams, CreateNodeParams, UpdateNodeParams, DeleteNodeParams, GetNodeParams, GetNodesParams, GetNodeChildrenParams, GenerateBlocksParams, GetVariableMetadataParams, CreateProductParams, UpdateProductParams, DeleteProductParams, GetProductParams, GetProductsParams, CreateOrderParams, UpdateOrderParams, GetOrderParams, GetOrdersParams, GetQuoteParams, OrderCheckoutParams, Slot, CreateReservationParams, UpdateReservationParams, ReservationCheckoutParams, GetReservationParams, SearchReservationsParams, GetReservationQuoteParams, CreateServiceParams, UpdateServiceParams, DeleteServiceParams, BulkScheduleParams, GetServiceParams, GetServicesParams, CreateProviderParams, UpdateProviderParams, DeleteProviderParams, GetProviderParams, GetProvidersParams, GetBusinessServiceWorkingTimeParams, CreateWorkflowParams, UpdateWorkflowParams, DeleteWorkflowParams, GetWorkflowParams, GetWorkflowsParams, TriggerWorkflowParams, CreateAudienceParams, UpdateAudienceParams, GetAudienceParams, GetAudiencesParams, SubscribeAudienceParams, GetAudienceSubscribersParams, RevokeAudienceSubscriptionParams, GetShippingRatesParams, ShippingRate, ShipParams, ShipResult } from './types.cjs';
|
|
2
|
+
export { Access, Address, AnalyticsConfig, ApiResponse, Audience, AudienceAccessResponse, AudienceSubscribeResponse, AudienceSubscriber, Block, Business, BusinessConfig, BusinessEvent, BusinessEventAction, BusinessShippingProvider, CustomsDeclaration, CustomsItem, DayAvailability, EshopCartItem, EshopStoreState, GeoLocation, GeoLocationBlock, GetAvailabilityParams, GetSlotsForDateParams, Language, Location, Market, Media, MediaResolution, Node, OrderShipping, PaginatedResponse, Parcel, Payment, PaymentMethod, PaymentMethodType, PaymentProviderConfig, PaymentRefund, Price, PromoCodeValidation, ProviderWithTimeline, PurchaseLabelResult, Quote, ReservationCartItem, ReservationStoreState, Shipment, ShipmentLine, ShippingAddress, ShippingMethod, ShippingProviderShippo, ShippingProviderStatus, ShippingStatus, ShippingWeightTier, SystemTemplateKey, Workflow, WorkflowEdge, WorkflowHttpMethod, WorkflowHttpNode, WorkflowIfNode, WorkflowLoopNode, WorkflowNode, WorkflowTriggerNode, WorkflowWaitNode, Zone, ZoneLocation } from './types.cjs';
|
|
3
3
|
import { f as formatPayment, a as formatMinor, g as getCurrencySymbol, b as getCurrencyName, i as isValidKey, v as validateKey, t as toKey, n as nameToKey, c as getAvailableStock, d as getReservedStock, h as hasStock, e as getInventoryAt, j as getFirstAvailableFCId } from './index-C28uWlRE.cjs';
|
|
4
4
|
|
|
5
5
|
interface AuthTokens {
|
|
@@ -291,7 +291,7 @@ declare function createArkySDK(config: HttpClientConfig & {
|
|
|
291
291
|
getRates(params: GetShippingRatesParams, options?: RequestOptions): Promise<{
|
|
292
292
|
rates: ShippingRate[];
|
|
293
293
|
}>;
|
|
294
|
-
|
|
294
|
+
ship(params: ShipParams, options?: RequestOptions): Promise<ShipResult>;
|
|
295
295
|
};
|
|
296
296
|
analytics: {
|
|
297
297
|
track: typeof track;
|
|
@@ -355,4 +355,4 @@ declare function createArkySDK(config: HttpClientConfig & {
|
|
|
355
355
|
getStripeConnectClientId: () => string;
|
|
356
356
|
}>;
|
|
357
357
|
|
|
358
|
-
export { type ApiConfig, type GetCountriesResponse, GetShippingRatesParams, type HttpClientConfig, type LocationCountry, type LocationState,
|
|
358
|
+
export { type ApiConfig, type GetCountriesResponse, GetShippingRatesParams, type HttpClientConfig, type LocationCountry, type LocationState, SDK_VERSION, SUPPORTED_FRAMEWORKS, ShipParams, ShipResult, ShippingRate, Slot, createArkySDK };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { RequestOptions, MagicLinkVerifyParams, MagicLinkRequestParams, UpdateAccountProfileParams, DeleteAccountParams, AddPhoneNumberParams, PhoneNumberConfirmParams, GetMeParams, SearchAccountsParams, AccountSubscribeParams, CreateBusinessParams, UpdateBusinessParams, DeleteBusinessParams, GetBusinessParams, GetBusinessesParams, GetBusinessParentsParams, TriggerBuildsParams, GetSubscriptionPlansParams, GetSubscriptionParams, SubscribeParams, CreatePortalSessionParams, InviteUserParams, HandleInvitationParams, TestWebhookParams, GetBusinessMediaParams2, ProcessRefundParams, GetBusinessEventsParams, UpdateBusinessEventParams, ConnectStripeParams, DisconnectStripeParams, UploadBusinessMediaParams, DeleteBusinessMediaParams, GetBusinessMediaParams, UpdateMediaParams, TrackEmailOpenParams, GetDeliveryStatsParams, CreatePromoCodeParams, UpdatePromoCodeParams, DeletePromoCodeParams, GetPromoCodeParams, GetPromoCodesParams, CreateNodeParams, UpdateNodeParams, DeleteNodeParams, GetNodeParams, GetNodesParams, GetNodeChildrenParams, GenerateBlocksParams, GetVariableMetadataParams, CreateProductParams, UpdateProductParams, DeleteProductParams, GetProductParams, GetProductsParams, CreateOrderParams, UpdateOrderParams, GetOrderParams, GetOrdersParams, GetQuoteParams, OrderCheckoutParams, Slot, CreateReservationParams, UpdateReservationParams, ReservationCheckoutParams, GetReservationParams, SearchReservationsParams, GetReservationQuoteParams, CreateServiceParams, UpdateServiceParams, DeleteServiceParams, BulkScheduleParams, GetServiceParams, GetServicesParams, CreateProviderParams, UpdateProviderParams, DeleteProviderParams, GetProviderParams, GetProvidersParams, GetBusinessServiceWorkingTimeParams, CreateWorkflowParams, UpdateWorkflowParams, DeleteWorkflowParams, GetWorkflowParams, GetWorkflowsParams, TriggerWorkflowParams, CreateAudienceParams, UpdateAudienceParams, GetAudienceParams, GetAudiencesParams, SubscribeAudienceParams, GetAudienceSubscribersParams, RevokeAudienceSubscriptionParams, GetShippingRatesParams, ShippingRate,
|
|
2
|
-
export { Access, AnalyticsConfig, ApiResponse, Audience, AudienceAccessResponse, AudienceSubscribeResponse, AudienceSubscriber, Block, Business, BusinessConfig, BusinessEvent, BusinessEventAction, BusinessShippingProvider, DayAvailability, EshopCartItem, EshopStoreState, GetAvailabilityParams, GetSlotsForDateParams, Language, Location, Market, Media, MediaResolution, Node, OrderShipping, PaginatedResponse, Parcel, Payment, PaymentMethod, PaymentMethodType, PaymentProviderConfig, PaymentRefund, Price, PromoCodeValidation, ProviderWithTimeline, Quote, ReservationCartItem, ReservationStoreState, ShippingAddress, ShippingMethod, ShippingProviderShippo, ShippingProviderStatus, ShippingStatus, ShippingWeightTier, SystemTemplateKey, Workflow, WorkflowEdge, WorkflowHttpMethod, WorkflowHttpNode, WorkflowIfNode, WorkflowLoopNode, WorkflowNode, WorkflowTriggerNode, WorkflowWaitNode, Zone } from './types.js';
|
|
1
|
+
import { RequestOptions, MagicLinkVerifyParams, MagicLinkRequestParams, UpdateAccountProfileParams, DeleteAccountParams, AddPhoneNumberParams, PhoneNumberConfirmParams, GetMeParams, SearchAccountsParams, AccountSubscribeParams, CreateBusinessParams, UpdateBusinessParams, DeleteBusinessParams, GetBusinessParams, GetBusinessesParams, GetBusinessParentsParams, TriggerBuildsParams, GetSubscriptionPlansParams, GetSubscriptionParams, SubscribeParams, CreatePortalSessionParams, InviteUserParams, HandleInvitationParams, TestWebhookParams, GetBusinessMediaParams2, ProcessRefundParams, GetBusinessEventsParams, UpdateBusinessEventParams, ConnectStripeParams, DisconnectStripeParams, UploadBusinessMediaParams, DeleteBusinessMediaParams, GetBusinessMediaParams, UpdateMediaParams, TrackEmailOpenParams, GetDeliveryStatsParams, CreatePromoCodeParams, UpdatePromoCodeParams, DeletePromoCodeParams, GetPromoCodeParams, GetPromoCodesParams, CreateNodeParams, UpdateNodeParams, DeleteNodeParams, GetNodeParams, GetNodesParams, GetNodeChildrenParams, GenerateBlocksParams, GetVariableMetadataParams, CreateProductParams, UpdateProductParams, DeleteProductParams, GetProductParams, GetProductsParams, CreateOrderParams, UpdateOrderParams, GetOrderParams, GetOrdersParams, GetQuoteParams, OrderCheckoutParams, Slot, CreateReservationParams, UpdateReservationParams, ReservationCheckoutParams, GetReservationParams, SearchReservationsParams, GetReservationQuoteParams, CreateServiceParams, UpdateServiceParams, DeleteServiceParams, BulkScheduleParams, GetServiceParams, GetServicesParams, CreateProviderParams, UpdateProviderParams, DeleteProviderParams, GetProviderParams, GetProvidersParams, GetBusinessServiceWorkingTimeParams, CreateWorkflowParams, UpdateWorkflowParams, DeleteWorkflowParams, GetWorkflowParams, GetWorkflowsParams, TriggerWorkflowParams, CreateAudienceParams, UpdateAudienceParams, GetAudienceParams, GetAudiencesParams, SubscribeAudienceParams, GetAudienceSubscribersParams, RevokeAudienceSubscriptionParams, GetShippingRatesParams, ShippingRate, ShipParams, ShipResult } from './types.js';
|
|
2
|
+
export { Access, Address, AnalyticsConfig, ApiResponse, Audience, AudienceAccessResponse, AudienceSubscribeResponse, AudienceSubscriber, Block, Business, BusinessConfig, BusinessEvent, BusinessEventAction, BusinessShippingProvider, CustomsDeclaration, CustomsItem, DayAvailability, EshopCartItem, EshopStoreState, GeoLocation, GeoLocationBlock, GetAvailabilityParams, GetSlotsForDateParams, Language, Location, Market, Media, MediaResolution, Node, OrderShipping, PaginatedResponse, Parcel, Payment, PaymentMethod, PaymentMethodType, PaymentProviderConfig, PaymentRefund, Price, PromoCodeValidation, ProviderWithTimeline, PurchaseLabelResult, Quote, ReservationCartItem, ReservationStoreState, Shipment, ShipmentLine, ShippingAddress, ShippingMethod, ShippingProviderShippo, ShippingProviderStatus, ShippingStatus, ShippingWeightTier, SystemTemplateKey, Workflow, WorkflowEdge, WorkflowHttpMethod, WorkflowHttpNode, WorkflowIfNode, WorkflowLoopNode, WorkflowNode, WorkflowTriggerNode, WorkflowWaitNode, Zone, ZoneLocation } from './types.js';
|
|
3
3
|
import { f as formatPayment, a as formatMinor, g as getCurrencySymbol, b as getCurrencyName, i as isValidKey, v as validateKey, t as toKey, n as nameToKey, c as getAvailableStock, d as getReservedStock, h as hasStock, e as getInventoryAt, j as getFirstAvailableFCId } from './index-GZfY5CmP.js';
|
|
4
4
|
|
|
5
5
|
interface AuthTokens {
|
|
@@ -291,7 +291,7 @@ declare function createArkySDK(config: HttpClientConfig & {
|
|
|
291
291
|
getRates(params: GetShippingRatesParams, options?: RequestOptions): Promise<{
|
|
292
292
|
rates: ShippingRate[];
|
|
293
293
|
}>;
|
|
294
|
-
|
|
294
|
+
ship(params: ShipParams, options?: RequestOptions): Promise<ShipResult>;
|
|
295
295
|
};
|
|
296
296
|
analytics: {
|
|
297
297
|
track: typeof track;
|
|
@@ -355,4 +355,4 @@ declare function createArkySDK(config: HttpClientConfig & {
|
|
|
355
355
|
getStripeConnectClientId: () => string;
|
|
356
356
|
}>;
|
|
357
357
|
|
|
358
|
-
export { type ApiConfig, type GetCountriesResponse, GetShippingRatesParams, type HttpClientConfig, type LocationCountry, type LocationState,
|
|
358
|
+
export { type ApiConfig, type GetCountriesResponse, GetShippingRatesParams, type HttpClientConfig, type LocationCountry, type LocationState, SDK_VERSION, SUPPORTED_FRAMEWORKS, ShipParams, ShipResult, ShippingRate, Slot, createArkySDK };
|
package/dist/index.js
CHANGED
|
@@ -497,11 +497,11 @@ var createMediaApi = (apiConfig) => {
|
|
|
497
497
|
return await response.json();
|
|
498
498
|
},
|
|
499
499
|
async updateMedia(params, options) {
|
|
500
|
-
const { mediaId, businessId, ...
|
|
500
|
+
const { mediaId, businessId, ...payload } = params;
|
|
501
501
|
const targetBusinessId = businessId || apiConfig.businessId;
|
|
502
502
|
return apiConfig.httpClient.put(
|
|
503
503
|
`/v1/businesses/${targetBusinessId}/media/${mediaId}`,
|
|
504
|
-
|
|
504
|
+
payload,
|
|
505
505
|
options
|
|
506
506
|
);
|
|
507
507
|
}
|
|
@@ -860,7 +860,8 @@ var createEshopApi = (apiConfig) => {
|
|
|
860
860
|
blocks: params.blocks || [],
|
|
861
861
|
paymentMethodId: params.paymentMethodId,
|
|
862
862
|
shippingMethodId: params.shippingMethodId,
|
|
863
|
-
promoCode: params.promoCode
|
|
863
|
+
promoCode: params.promoCode,
|
|
864
|
+
location: params.location
|
|
864
865
|
};
|
|
865
866
|
return apiConfig.httpClient.post(
|
|
866
867
|
`/v1/businesses/${apiConfig.businessId}/orders/quote`,
|
|
@@ -876,7 +877,9 @@ var createEshopApi = (apiConfig) => {
|
|
|
876
877
|
blocks: params.blocks || [],
|
|
877
878
|
paymentMethodId: params.paymentMethodId,
|
|
878
879
|
shippingMethodId: params.shippingMethodId,
|
|
879
|
-
promoCodeId: params.promoCodeId
|
|
880
|
+
promoCodeId: params.promoCodeId,
|
|
881
|
+
shippingAddress: params.shippingAddress,
|
|
882
|
+
billingAddress: params.billingAddress
|
|
880
883
|
};
|
|
881
884
|
return apiConfig.httpClient.post(
|
|
882
885
|
`/v1/businesses/${apiConfig.businessId}/orders/checkout`,
|
|
@@ -904,15 +907,11 @@ var createReservationApi = (apiConfig) => {
|
|
|
904
907
|
cart = [];
|
|
905
908
|
},
|
|
906
909
|
async createReservation(params, options) {
|
|
907
|
-
const { businessId, ...
|
|
910
|
+
const { businessId, ...payload } = params;
|
|
908
911
|
const targetBusinessId = businessId || apiConfig.businessId;
|
|
909
|
-
const payload = {
|
|
910
|
-
market: apiConfig.market,
|
|
911
|
-
...rest
|
|
912
|
-
};
|
|
913
912
|
return apiConfig.httpClient.post(
|
|
914
913
|
`/v1/businesses/${targetBusinessId}/reservations`,
|
|
915
|
-
payload,
|
|
914
|
+
{ market: apiConfig.market, ...payload },
|
|
916
915
|
options
|
|
917
916
|
);
|
|
918
917
|
},
|
|
@@ -925,22 +924,17 @@ var createReservationApi = (apiConfig) => {
|
|
|
925
924
|
);
|
|
926
925
|
},
|
|
927
926
|
async checkout(params, options) {
|
|
928
|
-
const { businessId, ...
|
|
927
|
+
const { businessId, items: paramItems, ...payload } = params || {};
|
|
929
928
|
const targetBusinessId = businessId || apiConfig.businessId;
|
|
930
|
-
const items =
|
|
929
|
+
const items = paramItems || cart.map((s) => ({
|
|
931
930
|
serviceId: s.serviceId,
|
|
932
931
|
providerId: s.providerId,
|
|
933
932
|
from: s.from,
|
|
934
933
|
to: s.to
|
|
935
934
|
}));
|
|
936
|
-
const payload = {
|
|
937
|
-
market: apiConfig.market,
|
|
938
|
-
...rest,
|
|
939
|
-
items
|
|
940
|
-
};
|
|
941
935
|
return apiConfig.httpClient.post(
|
|
942
936
|
`/v1/businesses/${targetBusinessId}/reservations/checkout`,
|
|
943
|
-
payload,
|
|
937
|
+
{ market: apiConfig.market, ...payload, items },
|
|
944
938
|
options
|
|
945
939
|
);
|
|
946
940
|
},
|
|
@@ -963,15 +957,11 @@ var createReservationApi = (apiConfig) => {
|
|
|
963
957
|
);
|
|
964
958
|
},
|
|
965
959
|
async getQuote(params, options) {
|
|
966
|
-
const { businessId, ...
|
|
960
|
+
const { businessId, ...payload } = params;
|
|
967
961
|
const targetBusinessId = businessId || apiConfig.businessId;
|
|
968
|
-
const payload = {
|
|
969
|
-
market: apiConfig.market,
|
|
970
|
-
...rest
|
|
971
|
-
};
|
|
972
962
|
return apiConfig.httpClient.post(
|
|
973
963
|
`/v1/businesses/${targetBusinessId}/reservations/quote`,
|
|
974
|
-
payload,
|
|
964
|
+
{ market: apiConfig.market, ...payload },
|
|
975
965
|
options
|
|
976
966
|
);
|
|
977
967
|
},
|
|
@@ -1273,8 +1263,8 @@ var createWorkflowApi = (apiConfig) => {
|
|
|
1273
1263
|
});
|
|
1274
1264
|
},
|
|
1275
1265
|
async triggerWorkflow(params, options) {
|
|
1276
|
-
const { secret, ...
|
|
1277
|
-
return apiConfig.httpClient.post(`/v1/workflows/trigger/${secret}`,
|
|
1266
|
+
const { secret, ...payload } = params;
|
|
1267
|
+
return apiConfig.httpClient.post(`/v1/workflows/trigger/${secret}`, payload, options);
|
|
1278
1268
|
}
|
|
1279
1269
|
};
|
|
1280
1270
|
};
|
|
@@ -1375,29 +1365,24 @@ var createPlatformApi = (apiConfig) => {
|
|
|
1375
1365
|
var createShippingApi = (apiConfig) => {
|
|
1376
1366
|
return {
|
|
1377
1367
|
/**
|
|
1378
|
-
* Get available shipping rates for
|
|
1368
|
+
* Get available shipping rates for a shipment
|
|
1379
1369
|
*/
|
|
1380
1370
|
async getRates(params, options) {
|
|
1371
|
+
const { orderId, ...payload } = params;
|
|
1381
1372
|
return apiConfig.httpClient.post(
|
|
1382
|
-
`/v1/businesses/${apiConfig.businessId}/orders/${
|
|
1383
|
-
|
|
1384
|
-
parcel: params.parcel,
|
|
1385
|
-
fromAddress: params.fromAddress
|
|
1386
|
-
},
|
|
1373
|
+
`/v1/businesses/${apiConfig.businessId}/orders/${orderId}/shipping/rates`,
|
|
1374
|
+
payload,
|
|
1387
1375
|
options
|
|
1388
1376
|
);
|
|
1389
1377
|
},
|
|
1390
1378
|
/**
|
|
1391
|
-
*
|
|
1379
|
+
* Ship items: creates shipment + purchases label atomically
|
|
1392
1380
|
*/
|
|
1393
|
-
async
|
|
1381
|
+
async ship(params, options) {
|
|
1382
|
+
const { orderId, ...payload } = params;
|
|
1394
1383
|
return apiConfig.httpClient.post(
|
|
1395
|
-
`/v1/businesses/${apiConfig.businessId}/orders/${
|
|
1396
|
-
|
|
1397
|
-
rateId: params.rateId,
|
|
1398
|
-
carrier: params.carrier,
|
|
1399
|
-
service: params.service
|
|
1400
|
-
},
|
|
1384
|
+
`/v1/businesses/${apiConfig.businessId}/orders/${orderId}/ship`,
|
|
1385
|
+
payload,
|
|
1401
1386
|
options
|
|
1402
1387
|
);
|
|
1403
1388
|
}
|