shipbob-node-sdk 0.0.13 → 0.0.16

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/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # ShipBob Node SDK
2
2
 
3
+ Feb 2026 - The various versions of their API are all set to expire soon. They have published a policy (https://developer.shipbob.com/versioning) indicating that future versions will be supported for 12 months from release date and that versions `1.0` and `2.0` are deprecated.
4
+
3
5
  First of all there are no official SDKs for ShipBob. I'm just dropping this here, in case it will speed up somebody else getting started using their API.
4
6
 
5
7
  This library uses the built-in node.js fetch, so you'll want a newer node version with undici support.
@@ -11,6 +13,25 @@ This SDK exposes some endpoints not available in the OpenAPI including:
11
13
  - `/experimental/product` :skull:
12
14
  - `/experimental/receiving` :skull:
13
15
 
16
+ As of Nov 2025 the OpenAPI specs (including 2025-07) are available for additional versions:
17
+ [Open API specs](https://developer.shipbob.com/faq#how-can-i-find-openapi-specs-for-each-api-version)
18
+
19
+ <div align="center">
20
+ <a href="https://www.npmjs.com/package/shipbob-node-sdk">
21
+ <img alt="Weekly downloads" src="https://badgen.net/npm/dw/shipbob-node-sdk?color=blue" />
22
+ </a>
23
+ </div>
24
+
25
+ ## install
26
+
27
+ ```bash
28
+ npm i shipbob-node-sdk
29
+ ```
30
+
31
+ ```bash
32
+ yarn add shipbob-node-sdk
33
+ ```
34
+
14
35
  Have a look in the `/test` folder. You might like more something like PostMan, but you can run and debug these "tests" in VS Code. You need a `.env` file like this:
15
36
 
16
37
  ```bash
@@ -372,3 +393,34 @@ const results = await api.experimentalReceivingSetExternalSync([443001], true);
372
393
  - Iterate through each box
373
394
  - Iterate through each item in the box_items array
374
395
  - Sync the stowed_quantity for each item back to your system
396
+
397
+ # Synchronizing inventory levels
398
+
399
+ There are no webhooks or easy way to sync. Plus once you place an order there is a delay (~1 minute) before the inventory levels are impacted.
400
+
401
+ So, if you have one FC, you can use total_sellable_quantity for each inventory item.
402
+
403
+ For multiple FCs - their recommendation is to use for each FC the fulfillable_quantity and subtract the total_exception_quantity (since it could be assigned to either FC).
404
+
405
+ ```json
406
+ {
407
+ "id": 1234,
408
+ "name": "...",
409
+ "total_fulfillable_quantity": 1688,
410
+ "total_onhand_quantity": 1688,
411
+ "total_committed_quantity": 0,
412
+ "total_sellable_quantity": 1688,
413
+ "total_exception_quantity": 0,
414
+ "fulfillable_quantity_by_fulfillment_center": [
415
+ {
416
+ "id": 211,
417
+ "name": "Fairburn (GA)",
418
+ "fulfillable_quantity": 1688,
419
+ "onhand_quantity": 1688,
420
+ "committed_quantity": 0,
421
+ "awaiting_quantity": 0,
422
+ "internal_transfer_quantity": 0
423
+ }
424
+ ]
425
+ }
426
+ ```
package/dist/types.d.ts CHANGED
@@ -589,6 +589,10 @@ export type Order = {
589
589
  export type PaymentShipTerm = 'Collect' | 'ThirdParty' | 'Prepaid' | 'MerchantResponsible';
590
590
  export type CarrierShipType = 'Parcel' | 'Freight';
591
591
  export type PlaceOrderRequest = {
592
+ /**
593
+ * Desired Fulfillment Center Location ID. If not specified, ShipBob will determine the location that fulfills this order.
594
+ */
595
+ location_id: null | number;
592
596
  /**
593
597
  * User friendly orderId or store order number that will be shown on the Orders Page. If not provided, referenceId will be used (<= 400 characters)
594
598
  */
@@ -678,6 +682,11 @@ export type PlaceOrderRequest = {
678
682
  * Enum: "DTC" "DropShip" "B2B" "Transportation"
679
683
  */
680
684
  type: OrderType;
685
+ /**
686
+ * Gift message associated with the order
687
+ * Maximum string length: 500
688
+ */
689
+ gift_message: string | null;
681
690
  };
682
691
  export type ShippingMethod = {
683
692
  /**
@@ -1070,6 +1079,9 @@ export declare enum ReturnAction {
1070
1079
  Dispose = 3
1071
1080
  }
1072
1081
  export type VariantRequestProductExperimental = Omit<VariantRequestProduct2_0, 'barcode'> & {
1082
+ /**
1083
+ * Multiple barcodes support added in 2.0
1084
+ */
1073
1085
  barcodes: {
1074
1086
  value: string;
1075
1087
  sticker_url: Nullable<string>;
@@ -1127,13 +1139,55 @@ export type VariantRequestProduct2_0 = {
1127
1139
  return_to_sender_primary_action_id: Nullable<ReturnAction>;
1128
1140
  return_to_sender_backup_action_id: Nullable<ReturnAction>;
1129
1141
  };
1130
- lot_information: {
1142
+ lot_information?: {
1131
1143
  /**
1132
1144
  * If the product should use lot date based picking
1133
1145
  */
1134
1146
  is_lot: boolean;
1135
1147
  minimum_shelf_life_days: Nullable<number>;
1136
1148
  };
1149
+ /**
1150
+ * This is not part of Open API spec, but found starting with Product 2.0
1151
+ */
1152
+ fulfillment_settings?: {
1153
+ is_bpm_parcel?: boolean;
1154
+ is_case_pick?: boolean;
1155
+ msds_url?: Nullable<string>;
1156
+ dangerous_goods?: boolean;
1157
+ /**
1158
+ * If the product requires a prop65 label in the box
1159
+ */
1160
+ requires_prop65?: boolean;
1161
+ serial_scan?: {
1162
+ /**
1163
+ * Indicates if a Serial Scan is required during the pack process.
1164
+ * Note: Serial scan requires either a prefix or a suffix to be defined
1165
+ */
1166
+ is_enabled: boolean;
1167
+ /**
1168
+ * The exact number of characters expected in the serial number
1169
+ */
1170
+ exact_character_length?: Nullable<number>;
1171
+ } & ({
1172
+ /**
1173
+ * The prefix expected on the serial number
1174
+ */
1175
+ prefix: string;
1176
+ /**
1177
+ * The suffix expected on the serial number
1178
+ */
1179
+ suffix?: Nullable<string>;
1180
+ } | {
1181
+ /**
1182
+ * The prefix expected on the serial number
1183
+ */
1184
+ prefix?: Nullable<string>;
1185
+ /**
1186
+ * The suffix expected on the serial number
1187
+ */
1188
+ suffix: string;
1189
+ });
1190
+ };
1137
1191
  };
1138
1192
  export type GetProductQueryStrings = Partial<{
1139
1193
  Page: number;
package/dist/types.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";;;AA8lCA,IAAY,oBAWX;AAXD,WAAY,oBAAoB;IAC9B,wBAAwB;IACxB,qFAAqB,CAAA;IACrB,qEAAW,CAAA;IACX,6EAAiB,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AAC,EAXW,oBAAoB,oCAApB,oBAAoB,QAW/B;AAED,IAAY,iBAWX;AAXD,WAAY,iBAAiB;IAC3B,uDAAS,CAAA;IACT,2EAAmB,CAAA;IACnB,uEAAiB,CAAA;IACjB,cAAc;IACd,uEAAiB,CAAA;IACjB,qEAAgB,CAAA;IAChB,iEAAc,CAAA;IACd,2FAA2B,CAAA;IAC3B,yFAA0B,CAAA;IAC1B,sFAAyB,CAAA;AAC3B,CAAC,EAXW,iBAAiB,iCAAjB,iBAAiB,QAW5B;AAED;;;;GAIG;AACH,IAAY,YAaX;AAbD,WAAY,YAAY;IACtB;;OAEG;IACH,qDAAW,CAAA;IACX;;OAEG;IACH,2DAAc,CAAA;IACd;;OAEG;IACH,qDAAW,CAAA;AACb,CAAC,EAbW,YAAY,4BAAZ,YAAY,QAavB;AAmXD;;;;GAIG;AACH,IAAY,YA8BX;AA9BD,WAAY,YAAY;IACtB;;;;OAIG;IACH,8CAA8B,CAAA;IAC9B;;;OAGG;IACH,wDAAwC,CAAA;IACxC;;;;OAIG;IACH,wDAAwC,CAAA;IACxC;;;;OAIG;IACH,kDAAkC,CAAA;IAClC;;;;OAIG;IACH,wDAAwC,CAAA;AAC1C,CAAC,EA9BW,YAAY,4BAAZ,YAAY,QA8BvB"}
package/package.json CHANGED
@@ -1,41 +1,41 @@
1
- {
2
- "name": "shipbob-node-sdk",
3
- "version": "0.0.13",
4
- "description": "ShipBob API node SDK",
5
- "types": "dist/index.d.ts",
6
- "main": "dist/index.js",
7
- "type": "commonjs",
8
- "scripts": {
9
- "prebuild": "rimraf dist && eslint . --ignore-pattern generated/ && prettier \"**/*.ts\" --check",
10
- "build": "tsc",
11
- "lint": "eslint . --ignore-pattern generated/",
12
- "prettier:write": "prettier \"**/*.ts\" \"*.md\" --write",
13
- "generate:client": "openapi-generator-cli generate -i openapi.json -g typescript -o generated/openapi --additional-properties=npmName=restClient,supportsES6=true,withInterfaces=true",
14
- "test": "mocha"
15
- },
16
- "author": "Brian Zinn",
17
- "license": "ISC",
18
- "devDependencies": {
19
- "@eslint/js": "^9.20.0",
20
- "@openapitools/openapi-generator-cli": "^2.16.3",
21
- "@types/mocha": "^10.0.10",
22
- "@types/node": "20",
23
- "dotenv": "^16.4.7",
24
- "eslint": "^9.20.1",
25
- "mocha": "^11.1.0",
26
- "prettier": "^3.5.1",
27
- "puppeteer": "^24.5.0",
28
- "rimraf": "^6.0.1",
29
- "tsx": "^4.19.3",
30
- "typescript": "^5.7.3",
31
- "typescript-eslint": "^8.24.1"
32
- },
33
- "peerDependencies": {
34
- "puppeteer": ">=22"
35
- },
36
- "peerDependenciesMeta": {
37
- "puppeteer": {
38
- "optional": true
39
- }
40
- }
41
- }
1
+ {
2
+ "name": "shipbob-node-sdk",
3
+ "version": "0.0.16",
4
+ "description": "ShipBob API node SDK",
5
+ "types": "dist/index.d.ts",
6
+ "main": "dist/index.js",
7
+ "type": "commonjs",
8
+ "scripts": {
9
+ "prebuild": "rimraf dist && eslint . --ignore-pattern generated/ && prettier \"**/*.ts\" --check",
10
+ "build": "tsc",
11
+ "lint": "eslint . --ignore-pattern generated/",
12
+ "prettier:write": "prettier \"**/*.ts\" \"*.md\" --write",
13
+ "generate:client": "openapi-generator-cli generate -i openapi.json -g typescript -o generated/openapi --additional-properties=npmName=restClient,supportsES6=true,withInterfaces=true",
14
+ "test": "mocha"
15
+ },
16
+ "author": "Brian Zinn",
17
+ "license": "ISC",
18
+ "devDependencies": {
19
+ "@eslint/js": "^9.20.0",
20
+ "@openapitools/openapi-generator-cli": "^2.16.3",
21
+ "@types/mocha": "^10.0.10",
22
+ "@types/node": "20",
23
+ "dotenv": "^16.4.7",
24
+ "eslint": "^9.20.1",
25
+ "mocha": "^11.1.0",
26
+ "prettier": "^3.5.1",
27
+ "puppeteer": "^24.5.0",
28
+ "rimraf": "^6.0.1",
29
+ "tsx": "^4.19.3",
30
+ "typescript": "^5.7.3",
31
+ "typescript-eslint": "^8.24.1"
32
+ },
33
+ "peerDependencies": {
34
+ "puppeteer": ">=22"
35
+ },
36
+ "peerDependenciesMeta": {
37
+ "puppeteer": {
38
+ "optional": true
39
+ }
40
+ }
41
+ }