shipbob-node-sdk 0.0.14 → 0.0.17
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 +49 -0
- package/dist/types.d.ts +10 -1
- package/dist/types.js.map +1 -1
- package/package.json +41 -41
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.
|
|
@@ -14,6 +16,22 @@ This SDK exposes some endpoints not available in the OpenAPI including:
|
|
|
14
16
|
As of Nov 2025 the OpenAPI specs (including 2025-07) are available for additional versions:
|
|
15
17
|
[Open API specs](https://developer.shipbob.com/faq#how-can-i-find-openapi-specs-for-each-api-version)
|
|
16
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
|
+
|
|
17
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:
|
|
18
36
|
|
|
19
37
|
```bash
|
|
@@ -375,3 +393,34 @@ const results = await api.experimentalReceivingSetExternalSync([443001], true);
|
|
|
375
393
|
- Iterate through each box
|
|
376
394
|
- Iterate through each item in the box_items array
|
|
377
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
|
@@ -577,7 +577,7 @@ export type Order = {
|
|
|
577
577
|
* probably good idea to use what is generated from the OpenAPI and reference here - the generated has lots of TS errors.
|
|
578
578
|
*/
|
|
579
579
|
shipments: OrderShipment[];
|
|
580
|
-
gift_message
|
|
580
|
+
gift_message?: string;
|
|
581
581
|
shipping_terms: {
|
|
582
582
|
/**
|
|
583
583
|
* ie: "Parcel"
|
|
@@ -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
|
/**
|
package/dist/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";;;AAwmCA,IAAY,oBAWX;AAXD,WAAY,oBAAoB;IAC9B,wBAAwB;IACxB,qFAAqB,CAAA;IACrB,qEAAW,CAAA;IACX,6EAAiB,CAAA;IACjB,iGAA2B,CAAA;IAC3B,qEAAa,CAAA;IACb,yEAAe,CAAA;IACf,2EAAgB,CAAA;IAChB,uLAAsE,CAAA;IACtE,iGAA2B,CAAA;AAC7B,CAAC,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.
|
|
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.17",
|
|
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
|
+
}
|