shipstation-client
Version:
ShipStation V2 SDK
173 lines (112 loc) • 4.72 kB
Markdown
All URIs are relative to *https://api.shipstation.com*
|Method | HTTP request | Description|
|------------- | ------------- | -------------|
|[**calculateRates**](
|[**estimateRates**](
|[**getRateById**](
> CalculateRatesResponseBody calculateRates(calculateRatesRequestBody)
It\'s not uncommon that you want to give your customer the choice between whether they want to ship the fastest, cheapest, or the most trusted route. Most companies don\'t solely ship things using a single shipping option; so we provide functionality to show you all your options!
```typescript
import {
RatesApi,
Configuration,
CalculateRatesRequestBody
} from 'shipstation-client';
const configuration = new Configuration();
const apiInstance = new RatesApi(configuration);
let calculateRatesRequestBody: CalculateRatesRequestBody; //
const { status, data } = await apiInstance.calculateRates(
calculateRatesRequestBody
);
```
|Name | Type | Description | Notes|
|------------- | ------------- | ------------- | -------------|
| **calculateRatesRequestBody** | **CalculateRatesRequestBody**| | |
**CalculateRatesResponseBody**
[](../README.md
- **Content-Type**: application/json
- **Accept**: application/json, text/plain
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**200** | The request was a success. | - |
|**400** | The request contained errors. | - |
|**500** | The request was successful. | - |
[[Back to top]](
> Array<RateEstimate> estimateRates(estimateRatesRequestBody)
Get Rate Estimates
### Example
```typescript
import {
RatesApi,
Configuration,
EstimateRatesRequestBody
} from 'shipstation-client';
const configuration = new Configuration();
const apiInstance = new RatesApi(configuration);
let estimateRatesRequestBody: EstimateRatesRequestBody; //
const { status, data } = await apiInstance.estimateRates(
estimateRatesRequestBody
);
```
|Name | Type | Description | Notes|
|------------- | ------------- | ------------- | -------------|
| **estimateRatesRequestBody** | **EstimateRatesRequestBody**| | |
**Array<RateEstimate>**
[](../README.md
- **Content-Type**: application/json
- **Accept**: application/json, text/plain
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**200** | The request was a success. | - |
|**400** | The request contained errors. | - |
|**500** | The request was successful. | - |
[[Back to top]](
> GetRateByIdResponseBody getRateById()
Retrieve a previously queried rate by its ID
### Example
```typescript
import {
RatesApi,
Configuration
} from 'shipstation-client';
const configuration = new Configuration();
const apiInstance = new RatesApi(configuration);
let rateId: string; //Rate ID (default to undefined)
const { status, data } = await apiInstance.getRateById(
rateId
);
```
|Name | Type | Description | Notes|
|------------- | ------------- | ------------- | -------------|
| **rateId** | [**string**] | Rate ID | defaults to undefined|
**GetRateByIdResponseBody**
[](../README.md
- **Content-Type**: Not defined
- **Accept**: application/json, text/plain
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**200** | The request was a success. | - |
|**400** | The request contained errors. | - |
|**404** | The API returns a 404 response when no &
|**500** | The request was successful. | - |
[[Back to top]](