Skip to content
This repository has been archived by the owner on Apr 25, 2024. It is now read-only.

Commit

Permalink
correct examples
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris committed Nov 2, 2021
1 parent 77c0557 commit bbb94aa
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
7 changes: 4 additions & 3 deletions example_batch.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ var myBatch = {
"distance_unit": "in",
"weight": "2",
"mass_unit": "oz"
}]
}
}}

},
{
"shipment": {
Expand Down Expand Up @@ -147,7 +147,7 @@ shippo.shipment.create({
console.log("Batch shipment creation response: %s", JSON.stringify(createResponse, null, 4));
//Poll a batch object to check for a VALID status before adding/removing shipments or purchasing
checkBatchStatus(createResponse.object_id);
});

//Using Batch::retrieve to poll for the batch's VALID status is done for demo purposes only
//In practice, it is recommended to register a Batch Create webhook for status updates
Expand Down Expand Up @@ -185,3 +185,4 @@ function checkBatchStatus(object_id) {
}
});
}

6 changes: 3 additions & 3 deletions example_tracking.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ a tracking number as well as how to register a webhook for tracking updates
var shippo = require('shippo')('<YOUR_PRIVATE_KEY>');

// example Tracking object for tracking a shipment
shippo.track.get_status('usps', '1122334455667788')
shippo.track.get_status('shippo', 'SHIPPO_TRANSIT')
.then(function(status) {
console.log("Tracking info: %s", JSON.stringify(status, null, 4));
}).catch(function(err) {
Expand All @@ -17,8 +17,8 @@ shippo.track.get_status('usps', '1122334455667788')

// example object for registering a webhook for tracking shipments
var webhookData = {
"carrier":"usps",
"tracking_number":"1122334455667788",
"carrier":"shippo",
"tracking_number":"SHIPPO_TRANSIT",
"metadata": "test order"
}

Expand Down

0 comments on commit bbb94aa

Please sign in to comment.