Repository navigation
feat: node v9 docs #259
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
feat: node v9 docs #259
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
c541573
chore: move node v8 examples from current to v8
Justintime50 ef9ccec
feat: add node v9 examples to current
Justintime50 64a67e6
fix: correct node v9 method names in examples
Justintime50 9ad6282
chore: bump @easypost/api to ^9.2.0
Justintime50 91a1628
fix: correct endshipper buy and report list args in node current exam…
Justintime50 47d6cb5
fix: correct method names and args in older node examples
Justintime50 989019e
chore: remove node v8 stripe public key example
Justintime50 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| const EasyPostClient = require('@easypost/api'); | ||
|
|
||
| const client = new EasyPostClient('EASYPOST_API_KEY'); | ||
|
|
||
| (async () => { | ||
| const address = await client.Address.createAndVerify({ | ||
| street1: '000 unknown street', | ||
| city: 'Not A City', | ||
| state: 'ZZ', | ||
| zip: '00001', | ||
| country: 'US', | ||
| email: '[email protected]', | ||
| phone: '5555555555', | ||
| }); | ||
|
|
||
| console.log(address); | ||
| })(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| const EasyPostClient = require('@easypost/api'); | ||
|
|
||
| const client = new EasyPostClient('EASYPOST_API_KEY'); | ||
|
|
||
| (async () => { | ||
| const address = await client.Address.create({ | ||
| street1: '417 MONTGOMERY ST', | ||
| street2: 'FLOOR 5', | ||
| city: 'SAN FRANCISCO', | ||
| state: 'CA', | ||
| zip: '94104', | ||
| country: 'US', | ||
| company: 'EasyPost', | ||
| phone: '415-123-4567', | ||
| }); | ||
|
|
||
| console.log(address); | ||
| })(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| const EasyPostClient = require('@easypost/api'); | ||
|
|
||
| const client = new EasyPostClient('EASYPOST_API_KEY'); | ||
|
|
||
| (async () => { | ||
| const addresses = await client.Address.all({ | ||
| page_size: 5, | ||
| }); | ||
|
|
||
| console.log(addresses); | ||
| })(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| const EasyPostClient = require('@easypost/api'); | ||
|
|
||
| const client = new EasyPostClient('EASYPOST_API_KEY'); | ||
|
|
||
| (async () => { | ||
| const address = await client.Address.retrieve('adr_...'); | ||
|
|
||
| console.log(address); | ||
| })(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| const EasyPostClient = require('@easypost/api'); | ||
|
|
||
| const client = new EasyPostClient('EASYPOST_API_KEY'); | ||
|
|
||
| (async () => { | ||
| const address = await client.Address.create({ | ||
| verify: true, | ||
| street1: '000 unknown street', | ||
| city: 'Not A City', | ||
| state: 'ZZ', | ||
| zip: '00001', | ||
| country: 'US', | ||
| email: '[email protected]', | ||
| phone: '5555555555', | ||
| }); | ||
|
|
||
| console.log(address); | ||
| })(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| const EasyPostClient = require('@easypost/api'); | ||
|
|
||
| const client = new EasyPostClient('EASYPOST_API_KEY'); | ||
|
|
||
| (async () => { | ||
| const address = await client.Address.create({ | ||
| verify_strict: true, | ||
| street1: '000 unknown street', | ||
| city: 'Not A City', | ||
| state: 'ZZ', | ||
| zip: '00001', | ||
| country: 'US', | ||
| email: '[email protected]', | ||
| phone: '5555555555', | ||
| }); | ||
|
|
||
| console.log(address); | ||
| })(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| const EasyPostClient = require('@easypost/api'); | ||
|
|
||
| const client = new EasyPostClient('EASYPOST_API_KEY'); | ||
|
|
||
| (async () => { | ||
| const address = await client.Address.verifyAddress('adr_...'); | ||
|
|
||
| console.log(address); | ||
| })(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| const EasyPostClient = require('@easypost/api'); | ||
|
|
||
| const client = new EasyPostClient('EASYPOST_API_KEY'); | ||
|
|
||
| (async () => { | ||
| const apiKey = await client.ApiKey.create('test'); | ||
|
|
||
| console.log(apiKey); | ||
| })(); | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| const EasyPostClient = require('@easypost/api'); | ||
|
|
||
| const client = new EasyPostClient('EASYPOST_API_KEY'); | ||
|
|
||
| (async () => { | ||
| await client.ApiKey.delete('ak_...'); | ||
| })(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| const EasyPostClient = require('@easypost/api'); | ||
|
|
||
| const client = new EasyPostClient('EASYPOST_API_KEY'); | ||
|
|
||
| (async () => { | ||
| const apiKey = await client.ApiKey.disable('ak_...'); | ||
|
|
||
| console.log(apiKey); | ||
|
Justintime50 marked this conversation as resolved.
Dismissed
|
||
| })(); | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| const EasyPostClient = require('@easypost/api'); | ||
|
|
||
| const client = new EasyPostClient('EASYPOST_API_KEY'); | ||
|
|
||
| (async () => { | ||
| const apiKey = await client.ApiKey.enable('ak_...'); | ||
|
|
||
| console.log(apiKey); | ||
|
Justintime50 marked this conversation as resolved.
Dismissed
|
||
| })(); | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| const EasyPostClient = require('@easypost/api'); | ||
|
|
||
| const client = new EasyPostClient('EASYPOST_API_KEY'); | ||
|
|
||
| (async () => { | ||
| // Retrieve all API keys including children | ||
| let apiKeys = await client.ApiKey.all(); | ||
|
|
||
| console.log(apiKeys); | ||
|
Justintime50 marked this conversation as resolved.
Dismissed
|
||
|
|
||
| // Retrieve API keys for a specific child user | ||
| let childApiKeys = await client.ApiKey.retrieveApiKeysForUser('user_...'); | ||
|
|
||
| console.log(childApiKeys); | ||
|
Justintime50 marked this conversation as resolved.
Dismissed
|
||
| })(); | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| const EasyPostClient = require('@easypost/api'); | ||
|
|
||
| const client = new EasyPostClient('EASYPOST_API_KEY'); | ||
|
|
||
| (async () => { | ||
| const batch = await client.Batch.addShipments('batch_...', ['shp_...', 'shp_...']); | ||
|
|
||
| console.log(batch); | ||
| })(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| const EasyPostClient = require('@easypost/api'); | ||
|
|
||
| const client = new EasyPostClient('EASYPOST_API_KEY'); | ||
|
|
||
| (async () => { | ||
| const createdBatch = await client.Batch.create({ | ||
| shipments: [ | ||
| { | ||
| from_address: { id: 'adr_...' }, | ||
| to_address: { id: 'adr_...' }, | ||
| parcel: { id: 'prcl_...' }, | ||
| service: 'First', | ||
| carrier: 'USPS', | ||
| carrier_accounts: ['ca_...'], | ||
| }, | ||
| ], | ||
| }); | ||
|
|
||
| const batch = await client.Batch.buy(createdBatch.id); | ||
|
|
||
| console.log(batch); | ||
| })(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| const EasyPostClient = require('@easypost/api'); | ||
|
|
||
| const client = new EasyPostClient('EASYPOST_API_KEY'); | ||
|
|
||
| (async () => { | ||
| const batch = await client.Batch.create({ | ||
| shipments: [{ id: 'shp_...' }, { id: 'shp_...' }], | ||
| }); | ||
|
|
||
| console.log(batch); | ||
| })(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| const EasyPostClient = require('@easypost/api'); | ||
|
|
||
| const client = new EasyPostClient('EASYPOST_API_KEY'); | ||
|
|
||
| (async () => { | ||
| const batch = await client.Batch.generateLabel('batch_...', 'PDF'); | ||
|
|
||
| console.log(batch); | ||
| })(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| const EasyPostClient = require('@easypost/api'); | ||
|
|
||
| const client = new EasyPostClient('EASYPOST_API_KEY'); | ||
|
|
||
| (async () => { | ||
| const batches = await client.Batch.all({ page_size: 5 }); | ||
|
|
||
| console.log(batches); | ||
| })(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| const EasyPostClient = require('@easypost/api'); | ||
|
|
||
| const client = new EasyPostClient('EASYPOST_API_KEY'); | ||
|
|
||
| (async () => { | ||
| const batch = await client.Batch.removeShipments('batch_...', ['shp_...']); | ||
|
|
||
| console.log(batch); | ||
| })(); |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.