shipstation-client
Version:
ShipStation V2 SDK
456 lines (319 loc) • 16.3 kB
Markdown
All URIs are relative to *https://api.shipstation.com*
|Method | HTTP request | Description|
|------------- | ------------- | -------------|
|[**cancelShipments**](
|[**getShipmentByExternalId**](
|[**getShipmentById**](
|[**listShipmentRates**](
|[**listShipments**](
|[**tagShipment**](
|[**untagShipment**](
> string cancelShipments()
Mark a shipment cancelled, if it is no longer needed or being used by your organized. Any label associated with the shipment needs to be voided first An example use case would be if a batch label creation job is going to run at a set time and only queries `pending` shipments. Marking a shipment as cancelled would remove it from this process
### Example
```typescript
import {
ShipmentsApi,
Configuration
} from 'shipstation-client';
const configuration = new Configuration();
const apiInstance = new ShipmentsApi(configuration);
let shipmentId: string; //Shipment ID (default to undefined)
const { status, data } = await apiInstance.cancelShipments(
shipmentId
);
```
|Name | Type | Description | Notes|
|------------- | ------------- | ------------- | -------------|
| **shipmentId** | [**string**] | Shipment ID | defaults to undefined|
**string**
[](../README.md
- **Content-Type**: Not defined
- **Accept**: text/plain, application/json
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**204** | The request was successful. | - |
|**400** | The request contained errors. | - |
|**404** | The specified resource does not exist. | - |
|**500** | The request was successful. | - |
[[Back to top]](
> GetShipmentByExternalIdResponseBody getShipmentByExternalId()
Query Shipments created using your own custom ID convention using this endpoint
### Example
```typescript
import {
ShipmentsApi,
Configuration
} from 'shipstation-client';
const configuration = new Configuration();
const apiInstance = new ShipmentsApi(configuration);
let externalShipmentId: string; // (default to undefined)
const { status, data } = await apiInstance.getShipmentByExternalId(
externalShipmentId
);
```
|Name | Type | Description | Notes|
|------------- | ------------- | ------------- | -------------|
| **externalShipmentId** | [**string**] | | defaults to undefined|
**GetShipmentByExternalIdResponseBody**
[](../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 specified resource does not exist. | - |
|**500** | The request was successful. | - |
[[Back to top]](
> GetShipmentByIdResponseBody getShipmentById()
Get an individual shipment based on its ID
### Example
```typescript
import {
ShipmentsApi,
Configuration
} from 'shipstation-client';
const configuration = new Configuration();
const apiInstance = new ShipmentsApi(configuration);
let shipmentId: string; //Shipment ID (default to undefined)
const { status, data } = await apiInstance.getShipmentById(
shipmentId
);
```
|Name | Type | Description | Notes|
|------------- | ------------- | ------------- | -------------|
| **shipmentId** | [**string**] | Shipment ID | defaults to undefined|
**GetShipmentByIdResponseBody**
[](../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 specified resource does not exist. | - |
|**500** | The request was successful. | - |
[[Back to top]](
> ListShipmentRatesResponseBody listShipmentRates()
Get Rates for the shipment information associated with the shipment ID
### Example
```typescript
import {
ShipmentsApi,
Configuration
} from 'shipstation-client';
const configuration = new Configuration();
const apiInstance = new ShipmentsApi(configuration);
let shipmentId: string; //Shipment ID (default to undefined)
let createdAtStart: string; //Used to create a filter for when a resource was created (ex. A shipment that was created after a certain time) (optional) (default to undefined)
const { status, data } = await apiInstance.listShipmentRates(
shipmentId,
createdAtStart
);
```
|Name | Type | Description | Notes|
|------------- | ------------- | ------------- | -------------|
| **shipmentId** | [**string**] | Shipment ID | defaults to undefined|
| **createdAtStart** | [**string**] | Used to create a filter for when a resource was created (ex. A shipment that was created after a certain time) | (optional) defaults to undefined|
### Return type
**ListShipmentRatesResponseBody**
### Authorization
[api_keys](../README.md#api_keys)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json, text/plain
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**200** | The request was a success. | - |
|**400** | The request contained errors. | - |
|**404** | The specified resource does not exist. | - |
|**500** | The request was successful. | - |
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **listShipments**
> ListShipmentsResponseBody listShipments()
Get list of Shipments
### Example
```typescript
import {
ShipmentsApi,
Configuration
} from 'shipstation-client';
const configuration = new Configuration();
const apiInstance = new ShipmentsApi(configuration);
let pickupId: string; // (default to undefined)
let shipmentStatus: ShipmentStatus; // (optional) (default to undefined)
let batchId: string; //Batch ID (optional) (default to undefined)
let createdAtStart: string; //Used to create a filter for when a resource was created (ex. A shipment that was created after a certain time) (optional) (default to undefined)
let createdAtEnd: string; //Used to create a filter for when a resource was created, (ex. A shipment that was created before a certain time) (optional) (default to undefined)
let modifiedAtStart: string; //Used to create a filter for when a resource was modified (ex. A shipment that was modified after a certain time) (optional) (default to undefined)
let modifiedAtEnd: string; //Used to create a filter for when a resource was modified (ex. A shipment that was modified before a certain time) (optional) (default to undefined)
let page: number; //Return a specific page of results. Defaults to the first page. If set to a number that\'s greater than the number of pages of results, an empty page is returned. (optional) (default to 1)
let pageSize: number; //The number of results to return per response. (optional) (default to 25)
let salesOrderId: string; //Sales Order ID (optional) (default to undefined)
let sortDir: SortDir; //Controls the sort order of the query. (optional) (default to undefined)
let shipmentNumber: string; //The user or order source defined shipment number (optional) (default to undefined)
let shipToName: string; //The name associated with the ship_to (optional) (default to undefined)
let itemKeyword: string; //Returns shipments that contain items that match the specified keyword. Fields searched are Sku, Description, and Options. (optional) (default to undefined)
let paymentDateStart: string; //Used to create a filter for resources based on the payment_date parameter after a certain time. (optional) (default to undefined)
let paymentDateEnd: string; //Used to create a filter for resources based on the payment_date parameter before a certain time. (optional) (default to undefined)
let storeId: string; //Store ID (optional) (default to undefined)
let externalShipmentId: string; // (optional) (default to undefined)
let sortBy: ShipmentsSortBy; // (optional) (default to undefined)
const { status, data } = await apiInstance.listShipments(
pickupId,
shipmentStatus,
batchId,
createdAtStart,
createdAtEnd,
modifiedAtStart,
modifiedAtEnd,
page,
pageSize,
salesOrderId,
sortDir,
shipmentNumber,
shipToName,
itemKeyword,
paymentDateStart,
paymentDateEnd,
storeId,
externalShipmentId,
sortBy
);
```
|Name | Type | Description | Notes|
|------------- | ------------- | ------------- | -------------|
| **pickupId** | [**string**] | | defaults to undefined|
| **shipmentStatus** | **ShipmentStatus** | | (optional) defaults to undefined|
| **batchId** | [**string**] | Batch ID | (optional) defaults to undefined|
| **createdAtStart** | [**string**] | Used to create a filter for when a resource was created (ex. A shipment that was created after a certain time) | (optional) defaults to undefined|
| **createdAtEnd** | [**string**] | Used to create a filter for when a resource was created, (ex. A shipment that was created before a certain time) | (optional) defaults to undefined|
| **modifiedAtStart** | [**string**] | Used to create a filter for when a resource was modified (ex. A shipment that was modified after a certain time) | (optional) defaults to undefined|
| **modifiedAtEnd** | [**string**] | Used to create a filter for when a resource was modified (ex. A shipment that was modified before a certain time) | (optional) defaults to undefined|
| **page** | [**number**] | Return a specific page of results. Defaults to the first page. If set to a number that\'s greater than the number of pages of results, an empty page is returned. | (optional) defaults to 1|
| **pageSize** | [**number**] | The number of results to return per response. | (optional) defaults to 25|
| **salesOrderId** | [**string**] | Sales Order ID | (optional) defaults to undefined|
| **sortDir** | **SortDir** | Controls the sort order of the query. | (optional) defaults to undefined|
| **shipmentNumber** | [**string**] | The user or order source defined shipment number | (optional) defaults to undefined|
| **shipToName** | [**string**] | The name associated with the ship_to | (optional) defaults to undefined|
| **itemKeyword** | [**string**] | Returns shipments that contain items that match the specified keyword. Fields searched are Sku, Description, and Options. | (optional) defaults to undefined|
| **paymentDateStart** | [**string**] | Used to create a filter for resources based on the payment_date parameter after a certain time. | (optional) defaults to undefined|
| **paymentDateEnd** | [**string**] | Used to create a filter for resources based on the payment_date parameter before a certain time. | (optional) defaults to undefined|
| **storeId** | [**string**] | Store ID | (optional) defaults to undefined|
| **externalShipmentId** | [**string**] | | (optional) defaults to undefined|
| **sortBy** | **ShipmentsSortBy** | | (optional) defaults to undefined|
**ListShipmentsResponseBody**
[](../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 specified resource does not exist. | - |
|**500** | The request was successful. | - |
[[Back to top]](
> TagShipmentResponseBody tagShipment()
Add a tag to the shipment object
### Example
```typescript
import {
ShipmentsApi,
Configuration
} from 'shipstation-client';
const configuration = new Configuration();
const apiInstance = new ShipmentsApi(configuration);
let shipmentId: string; //Shipment ID (default to undefined)
let tagName: string; // (default to undefined)
const { status, data } = await apiInstance.tagShipment(
shipmentId,
tagName
);
```
|Name | Type | Description | Notes|
|------------- | ------------- | ------------- | -------------|
| **shipmentId** | [**string**] | Shipment ID | defaults to undefined|
| **tagName** | [**string**] | | defaults to undefined|
**TagShipmentResponseBody**
[](../README.md
- **Content-Type**: Not defined
- **Accept**: application/json, text/plain
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**200** | The requested object creation was a success. | - |
|**400** | The request contained errors. | - |
|**404** | The specified resource does not exist. | - |
|**500** | The request was successful. | - |
[[Back to top]](
> string untagShipment()
Remove an existing tag from the Shipment object
### Example
```typescript
import {
ShipmentsApi,
Configuration
} from 'shipstation-client';
const configuration = new Configuration();
const apiInstance = new ShipmentsApi(configuration);
let shipmentId: string; //Shipment ID (default to undefined)
let tagName: string; // (default to undefined)
const { status, data } = await apiInstance.untagShipment(
shipmentId,
tagName
);
```
|Name | Type | Description | Notes|
|------------- | ------------- | ------------- | -------------|
| **shipmentId** | [**string**] | Shipment ID | defaults to undefined|
| **tagName** | [**string**] | | defaults to undefined|
**string**
[](../README.md
- **Content-Type**: Not defined
- **Accept**: text/plain, application/json
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**204** | The request was successful. | - |
|**400** | The request contained errors. | - |
|**404** | The specified resource does not exist. | - |
|**500** | The request was successful. | - |
[[Back to top]](