nomad_pilot_cli
v1.53.0
Published
This_is_the_API_descriptor_for_the_Nomad_Pilot_API_responsible_for_shipping_and_logistics_processing__Developed_by__Samarkand_Global_https__www_samarkand_global__in_partnership_with__SF_Express_https__www_sf_express_com___eSinotrans_http__air_esinotrans_c
Downloads
10
Readme
nomad_pilot_cli
NomadPilotCli - JavaScript client for nomad_pilot_cli This is the API descriptor for the Nomad Pilot API, responsible for shipping and logistics processing. Developed by Samarkand Global in partnership with SF Express, eSinotrans, sto. Read the documentation online at Nomad API Suite.
Install for node with
npm install nomad_pilot_cli
Install for python with
pip install nomad-pilot-cli
Install for Maven users
groupId, com.gitlab.samarkand-nomad; artifactId, nomad-pilot-cli
This SDK is automatically generated by the OpenAPI Generator project:API version: 1.53.0
Package version: 1.53.0
Build package: org.openapitools.codegen.languages.JavascriptClientCodegen
Installation
For Node.js
npm
To publish the library as a npm, please follow the procedure in "Publishing npm packages".
Then install it via:
npm install nomad_pilot_cli --save
Finally, you need to build the module:
npm run build
Local development
To use the library locally without publishing to a remote npm registry, first install the dependencies by changing into the directory containing package.json
(and this README). Let's call this JAVASCRIPT_CLIENT_DIR
. Then run:
npm install
Next, link it globally in npm with the following, also from JAVASCRIPT_CLIENT_DIR
:
npm link
To use the link you just defined in your project, switch to the directory you want to use your nomad_pilot_cli from, and run:
npm link /path/to/<JAVASCRIPT_CLIENT_DIR>
Finally, you need to build the module:
npm run build
git
If the library is hosted at a git repository, e.g.https://github.com/GIT_USER_ID/GIT_REPO_ID then install it via:
npm install GIT_USER_ID/GIT_REPO_ID --save
For browser
The library also works in the browser environment via npm and browserify. After following
the above steps with Node.js and installing browserify with npm install -g browserify
,
perform the following (assuming main.js is your entry file):
browserify main.js > bundle.js
Then include bundle.js in the HTML pages.
Webpack Configuration
Using Webpack you may encounter the following error: "Module not found: Error: Cannot resolve module", most certainly you should disable AMD loader. Add/merge the following section to your webpack config:
module: {
rules: [
{
parser: {
amd: false
}
}
]
}
Getting Started
Please follow the installation instruction and execute the following JS code:
const nomadPilotCli = require("/nomad_javascript_client");
var defaultClient = nomadPilotCli.ApiClient.instance;
defaultClient.defaultHeaders["x-ca-stage"] = "test";
defaultClient.defaultHeaders["Authorization"] = "APPCODE " +
process.env["ALICLOUD_APIGATEWAY_APP_API_KEY"];
var api = new nomadPilotCli.ShipApi();
var carrier = "samarkand.sinotrans.test";
const packageData = {
"orderRef": "CHT1542019685",
"sellerOrderRef": "Iceland123456",
"currency": "RMB",
"dimension": { "weight": 0.49, "height": 1, "length": 1, "width": 1 },
"items": [
{ "name": "综合维生素片", "barcode": null, "quantity": 6, "price": 150, "brand": null,
"quantityUom": "50G", "hsCode": "2104200000", "countryOfOrigin": "United States", "goldjet": { "goodsPtcode": "27000000" } },
{ "name": "牙膏", "barcode": null, "quantity": 3, "price": 10, "brand": null,
"quantityUom": "50G", "hsCode": "2104200000", "countryOfOrigin": "United States", "goldjet": { "goodsPtcode": "27000000" } }],
"shipFrom": { "firstName": "Zonghai", "lastName": "Liang", "address1": "6804 NE 79th Ct.", "address2": "foobar", "city": "纽约", "state": "纽约州", "country": "US", "zip": "EC1N 2SW", "tin": "tin", "phone": "123456", "countryCode": "US", "email": "[email protected]" },
"shipTo": { "firstName": "小", "lastName": "张", "address1": "天河区^^^中山大道", "address2": null, "city": "广州市", "state": "广东省", "country": "CN", "zip": "1000", "tin": null, "phone": "123456", "countryCode": null, "email": "[email protected]" },
"bill": { "firstName": "小明", "lastName": "王", "address1": "天河区^^^中山大道", "address2": null, "city": "广州市", "state": "广东省", "country": "CN", "zip": null, "tin": null, "phone": "123456", "countryCode": null, "email": "[email protected]" }
};
var pkg = new nomadPilotCli.ModelPackage.constructFromObject(packageData);
pkg.orderRef += Date.now()
// https://jsrun.net/app/sfz
pkg.shipTo.idCard = "420101197301115218"
pkg.bill.idCard = "42010119940927595X"
var callback = function (error, data, response) {
if (error) {
console.error(error);
} else {
console.log("API called successfully. Returned data: " + data.data);
console.log(data);
}
};
/* POST */
api.ship(carrier, pkg, callback);
/* GET */
api.queryShip(carrier, pkg.orderRef, pkg.sellerOrderRef, callback);
/* DELETE */
api.cancelShip(carrier, pkg.orderRef, callback);
Documentation for API Endpoints
All URIs are relative to https://nomad.samarkand-global.cn/pilot
Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- NomadPilotCli.BatchApi | addParcel | POST /ship/{carrier}/batch/{batch_id}/add-to-batch | batch NomadPilotCli.BatchApi | createBatch | POST /ship/{carrier}/create-batch | batch NomadPilotCli.BatchApi | removeParcel | POST /ship/{carrier}/batch/{batch_id}/remove-from-batch | batch NomadPilotCli.BatchApi | scanBatch | POST /ship/{carrier}/batch/{batch_id}/create-scan-form | batch NomadPilotCli.CallbackApi | callback | POST /callback/{store} | callback NomadPilotCli.CarriersApi | queryCarrier | GET /carriers/ | queryCarrier NomadPilotCli.FreightForwardApi | freightForward | POST /freight-forward/{carrier} | freightForward NomadPilotCli.FreightForwardApi | putFreightForwardProduct | PUT /freight-forward/product/{carrier} | freightForward NomadPilotCli.FreightForwardApi | queryFreightForward | GET /freight-forward/{carrier} | queryFreightForward NomadPilotCli.InventoryApi | getInventoryProduct | GET /inventory/product/{carrier} | inventory NomadPilotCli.InventoryApi | postInventoryProduct | POST /inventory/product/{carrier} | inventory NomadPilotCli.InventoryApi | putInventoryProduct | PUT /inventory/product/{carrier} | inventory NomadPilotCli.InventoryPurchaseApi | deleteInventoryPurchase | DELETE /inventory/purchase/{carrier} | inventory_purchase NomadPilotCli.InventoryPurchaseApi | getInventoryPurchase | GET /inventory/purchase/{carrier} | inventory_purchase NomadPilotCli.InventoryPurchaseApi | postInventoryPurchase | POST /inventory/purchase/{carrier} | inventory_purchase NomadPilotCli.QuickShipApi | quickShip | POST /quick-ship/{carrier} | quickShip NomadPilotCli.ShipApi | cancelShip | DELETE /ship/{carrier}/order/{seller_order_ref} | cancelShip NomadPilotCli.ShipApi | putShip | PUT /ship/{carrier} | ship NomadPilotCli.ShipApi | queryShip | GET /ship/{carrier}/order/{seller_order_ref} | queryShip NomadPilotCli.ShipApi | ship | POST /ship/{carrier} | ship NomadPilotCli.ShipConfirmApi | shipConfirm | POST /ship/{carrier}/confirm | shipConfirm
Documentation for Models
- NomadPilotCli.Address
- NomadPilotCli.AddressRequired
- NomadPilotCli.AddressShip
- NomadPilotCli.ApiResponse
- NomadPilotCli.ApiResponseCallback
- NomadPilotCli.ApiResponseConnectorResponse
- NomadPilotCli.ApiResponseData
- NomadPilotCli.ApiResponseGeneral
- NomadPilotCli.ApiResponseInventory
- NomadPilotCli.CallbackBody
- NomadPilotCli.DeliveryStatus
- NomadPilotCli.Dimension
- NomadPilotCli.Goldjet
- NomadPilotCli.HaikuDeliveryOrder
- NomadPilotCli.InlineObject
- NomadPilotCli.InlineObject1
- NomadPilotCli.InventoryBase
- NomadPilotCli.InventoryProduct
- NomadPilotCli.InventoryPurchase
- NomadPilotCli.InventoryPurchaseItem
- NomadPilotCli.InventoryResponseProduct
- NomadPilotCli.InventoryResponsePurchase
- NomadPilotCli.ModelPackage
- NomadPilotCli.Pack
- NomadPilotCli.PackBased
- NomadPilotCli.PackageFreight
- NomadPilotCli.PackageItem
- NomadPilotCli.PackageItemQuick
- NomadPilotCli.PackageItems
- NomadPilotCli.PackageItemsQuick
- NomadPilotCli.PackagePut
- NomadPilotCli.PackagePutRequired
- NomadPilotCli.PackageQuick
- NomadPilotCli.PackageRequired
- NomadPilotCli.PackageUpdate
- NomadPilotCli.PackageUpdateRequired
- NomadPilotCli.ProductFreight
Documentation for Authorization
ca_key
- Type: API key
- API key parameter name: x-ca-key
- Location: HTTP header
ca_stage
- Type: API key
- API key parameter name: x-ca-stage
- Location: HTTP header