Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/node/current/billing/list.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const EasyPostClient = require('@easypost/api');
const client = new EasyPostClient('EASYPOST_API_KEY');

(async () => {
const paymentMethods = await client.Billing.all();
const paymentMethods = await client.Billing.retrievePaymentMethods();

console.log(paymentMethods);
})();
2 changes: 1 addition & 1 deletion docs/node/current/billing/retrieve-stripe-public-key.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const EasyPostClient = require('@easypost/api');
const client = new EasyPostClient('EASYPOST_API_KEY');

(async () => {
const response = await client.BetaReferralCustomer.retrieveEasyPostStripeApiKey();
const response = await client.ReferralCustomer.retrieveEasyPostStripeApiKey();

console.log(response);
})();
1 change: 0 additions & 1 deletion docs/node/current/endshipper/buy.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ const client = new EasyPostClient('EASYPOST_API_KEY');
retrievedShipment.id,
retrievedShipment.lowestRate(),
null,
false,
'es_...',
);

Expand Down
2 changes: 1 addition & 1 deletion docs/node/current/luma/buy.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const client = new EasyPost('EASYPOST_API_KEY');
deliver_by_date: '2025-07-20',
};

const shipment = await client.Luma.buyLuma('shp_...', params);
const shipment = await client.Shipment.buyLuma('shp_...', params);

console.log(shipment);
})();
2 changes: 1 addition & 1 deletion docs/node/current/luma/one-call-buy.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const EasyPost = require('@easypost/api');
const client = new EasyPost('EASYPOST_API_KEY');

(async () => {
const shipment = await client.Luma.createAndBuyLuma({
const shipment = await client.Shipment.createAndBuyLuma({
carrier_accounts: ['ca_...'],
to_address: {
name: 'Dr. Steve Brule',
Expand Down
2 changes: 1 addition & 1 deletion docs/node/current/luma/promise.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const client = new EasyPost('EASYPOST_API_KEY');
deliver_by_date: '2025-07-20',
};

const promise = await client.Luma.promise(params);
const promise = await client.Luma.getPromise(params);

console.log(promise);
})();
2 changes: 1 addition & 1 deletion docs/node/current/rates/retrieve-stateless.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const client = new EasyPostClient('EASYPOST_API_KEY');
},
};

const rates = await client.BetaRate.retrieveStatelessRates(shipmentDetails);
const { rates } = await client.BetaRate.retrieveStatelessRates(shipmentDetails);

console.log(rates);
})();
2 changes: 1 addition & 1 deletion docs/node/current/reports/list.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const client = new EasyPostClient('EASYPOST_API_KEY');

(async () => {
// Replace `payment_log` with any of the report types listed above
const reports = await client.Report.all('payment_log', { page_size: 5 });
const reports = await client.Report.all({ type: 'payment_log', page_size: 5 });

console.log(reports);
})();
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const EasyPostClient = require('@easypost/api');
const client = new EasyPostClient('EASYPOST_API_KEY');

(async () => {
const smartRates = await client.Shipment.getSmartrates('shp_...');
const smartRates = await client.Shipment.getSmartRates('shp_...');

console.log(smartRates);
})();
2 changes: 1 addition & 1 deletion docs/node/v5/billing/list.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ const Easypost = require('@easypost/api');

const api = new Easypost('EASYPOST_API_KEY');

api.Billing.all().then(console.log);
api.Billing.retrievePaymentMethods().then(console.log);
2 changes: 1 addition & 1 deletion docs/node/v6/billing/create-ep-credit-card.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const EasyPostClient = require('@easypost/api');
const client = new EasyPostClient('EASYPOST_API_KEY');

(async () => {
const creditCard = await client.Referral.addCreditCard(
const creditCard = await client.ReferralCustomer.addCreditCard(
'REFERRAL_USER_API_KEY',
'0123456789101234',
'01',
Expand Down
2 changes: 1 addition & 1 deletion docs/node/v6/billing/list.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const EasyPostClient = require('@easypost/api');
const client = new EasyPostClient('EASYPOST_API_KEY');

(async () => {
const paymentMethods = await client.Billing.all();
const paymentMethods = await client.Billing.retrievePaymentMethods();

console.log(paymentMethods);
})();
2 changes: 1 addition & 1 deletion docs/node/v6/reports/list.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const client = new EasyPostClient('EASYPOST_API_KEY');

(async () => {
// Replace `payment_log` with any of the report types listed above
const reports = await client.Report.all('payment_log', { page_size: 5 });
const reports = await client.Report.all({ type: 'payment_log', page_size: 5 });

console.log(reports);
})();
2 changes: 1 addition & 1 deletion docs/node/v7/billing/create-ep-credit-card.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const EasyPostClient = require('@easypost/api');
const client = new EasyPostClient('EASYPOST_API_KEY');

(async () => {
const creditCard = await client.Referral.addCreditCard(
const creditCard = await client.ReferralCustomer.addCreditCard(
'REFERRAL_USER_API_KEY',
'0123456789101234',
'01',
Expand Down
2 changes: 1 addition & 1 deletion docs/node/v7/billing/list.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const EasyPostClient = require('@easypost/api');
const client = new EasyPostClient('EASYPOST_API_KEY');

(async () => {
const paymentMethods = await client.Billing.all();
const paymentMethods = await client.Billing.retrievePaymentMethods();

console.log(paymentMethods);
})();
1 change: 0 additions & 1 deletion docs/node/v7/endshipper/buy.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ const client = new EasyPostClient('EASYPOST_API_KEY');
retrievedShipment.id,
retrievedShipment.lowestRate(),
null,
false,
'es_...',
);

Expand Down
2 changes: 1 addition & 1 deletion docs/node/v7/reports/list.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const client = new EasyPostClient('EASYPOST_API_KEY');

(async () => {
// Replace `payment_log` with any of the report types listed above
const reports = await client.Report.all('payment_log', { page_size: 5 });
const reports = await client.Report.all({ type: 'payment_log', page_size: 5 });

console.log(reports);
})();
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const EasyPostClient = require('@easypost/api');
const client = new EasyPostClient('EASYPOST_API_KEY');

(async () => {
const smartRates = await client.Shipment.getSmartrates('shp_...');
const smartRates = await client.Shipment.getSmartRates('shp_...');

console.log(smartRates);
})();
17 changes: 17 additions & 0 deletions docs/node/v8/addresses/create-and-verify.js
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);
})();
18 changes: 18 additions & 0 deletions docs/node/v8/addresses/create.js
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);
})();
11 changes: 11 additions & 0 deletions docs/node/v8/addresses/list.js
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);
})();
9 changes: 9 additions & 0 deletions docs/node/v8/addresses/retrieve.js
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);
})();
18 changes: 18 additions & 0 deletions docs/node/v8/addresses/verify-param.js
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);
})();
18 changes: 18 additions & 0 deletions docs/node/v8/addresses/verify-strict-param.js
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);
})();
9 changes: 9 additions & 0 deletions docs/node/v8/addresses/verify.js
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);
})();
9 changes: 9 additions & 0 deletions docs/node/v8/api-keys/create.js
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);
Comment thread
Justintime50 marked this conversation as resolved.
Dismissed
})();
7 changes: 7 additions & 0 deletions docs/node/v8/api-keys/delete.js
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_...');
})();
9 changes: 9 additions & 0 deletions docs/node/v8/api-keys/disable.js
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);
Comment thread
Justintime50 marked this conversation as resolved.
Dismissed
})();
9 changes: 9 additions & 0 deletions docs/node/v8/api-keys/enable.js
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);
Comment thread
Justintime50 marked this conversation as resolved.
Dismissed
})();
15 changes: 15 additions & 0 deletions docs/node/v8/api-keys/retrieve.js
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);
Comment thread
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);
Comment thread
Justintime50 marked this conversation as resolved.
Dismissed
})();
9 changes: 9 additions & 0 deletions docs/node/v8/batches/add-shipments.js
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);
})();
22 changes: 22 additions & 0 deletions docs/node/v8/batches/buy.js
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);
})();
11 changes: 11 additions & 0 deletions docs/node/v8/batches/create.js
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);
})();
9 changes: 9 additions & 0 deletions docs/node/v8/batches/label.js
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);
})();
9 changes: 9 additions & 0 deletions docs/node/v8/batches/list.js
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);
})();
9 changes: 9 additions & 0 deletions docs/node/v8/batches/remove-shipments.js
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);
})();
Loading
Loading