arky-sdk 0.4.40 → 0.4.42

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 CHANGED
@@ -1373,6 +1373,38 @@ var createPlatformApi = (apiConfig) => {
1373
1373
  };
1374
1374
  };
1375
1375
 
1376
+ // src/api/shipping.ts
1377
+ var createShippingApi = (apiConfig) => {
1378
+ return {
1379
+ /**
1380
+ * Get available shipping rates for an order
1381
+ */
1382
+ async getRates(params, options) {
1383
+ return apiConfig.httpClient.post(
1384
+ `/v1/businesses/${apiConfig.businessId}/orders/${params.orderId}/shipping/rates`,
1385
+ {
1386
+ parcel: params.parcel
1387
+ },
1388
+ options
1389
+ );
1390
+ },
1391
+ /**
1392
+ * Purchase a shipping label using a selected rate
1393
+ */
1394
+ async purchaseLabel(params, options) {
1395
+ return apiConfig.httpClient.post(
1396
+ `/v1/businesses/${apiConfig.businessId}/orders/${params.orderId}/shipping/purchase`,
1397
+ {
1398
+ rateId: params.rateId,
1399
+ carrier: params.carrier,
1400
+ service: params.service
1401
+ },
1402
+ options
1403
+ );
1404
+ }
1405
+ };
1406
+ };
1407
+
1376
1408
  // src/utils/price.ts
1377
1409
  function formatCurrency(amount, currencyCode, locale = "en") {
1378
1410
  return new Intl.NumberFormat(locale, {
@@ -1693,6 +1725,7 @@ async function createArkySDK(config) {
1693
1725
  network: createNetworkApi(apiConfig),
1694
1726
  workflow: createWorkflowApi(apiConfig),
1695
1727
  audience: createAudienceApi(apiConfig),
1728
+ shipping: createShippingApi(apiConfig),
1696
1729
  analytics: {
1697
1730
  track
1698
1731
  },