shipwire.containers
Module shipwire.containers
Definitions
![](https://bcentral-packageicons.azureedge.net/images/ballerinax_shipwire.containers_1.1.0.png)
ballerinax/shipwire.containers Ballerina library
Overview
This is a generated connector for Shipwire Containers API v3.0 OpenAPI specification. The Container API is used to manage shipping containers and boxes within Shipwire Anywhere warehouses and dropship locations. Use it to create a new container, to update an existing container, or to get information about already created containers.
Prerequisites
Before using this connector in your Ballerina application, complete the following:
- Create Shipwire account
- Obtain tokens by following this guide
Quickstart
To use the Shipwire Containers connector in your Ballerina application, update the .bal file as follows:
Step 1: Import connector
First, import the ballerinax/shipwire.containers
module into the Ballerina project.
import ballerinax/shipwire.containers;
Step 2: Create a new connector instance
Create a containers:ClientConfig
with the token obtained, and initialize the connector with it.
containers:ClientConfig clientConfig = { auth: { token: <ACCESS_TOKEN> } }; containers:Client baseClient = check new Client(clientConfig);
Step 3: Invoke connector operation
-
Now you can use the operations available within the connector. Note that they are in the form of remote operations.
Following is an example on how to get a collection of containers using the connector.
Get a collection of containers
public function main() { containers:GetContainersResponse|error response = baseClient->getContainers(); if (response is containers:GetContainersResponse) { log:printInfo(response.toString()); } else { log:printError(response.message()); } }
-
Use
bal run
command to compile and run the Ballerina program.
Clients![](/images/permalink.svg)
shipwire.containers: Client![](/images/permalink.svg)
This is a generated connector for Shipwire Containers API v3.0 OpenAPI specification. The Container API is used to manage shipping containers and boxes within Shipwire Anywhere warehouses and dropship locations. Use it to create a new container, to update an existing container, or to get information about already created containers.
Constructor![](/images/permalink.svg)
Gets invoked to initialize the connector
.
The connector initialization requires setting the API credentials.
Create a Shipwire account and obtain tokens by following this guide.
init (ClientConfig clientConfig, string serviceUrl)
- clientConfig ClientConfig - The configurations to be used when initializing the
connector
- serviceUrl string "https://api.shipwire.com/" - URL of the target service
getContainers![](/images/permalink.svg)
function getContainers(int? isActive, string? warehouseIds, string? warehouseExternalIds, string[]? 'type) returns GetContainersResponse|error
Get containers
Parameters
- isActive int? (default ()) - Returns containers that are active or not. Valid options are 1 or 0.
- warehouseIds string? (default ()) - Returns all containers that exist in the provided warehouse. Single warehouse's id or comma separated list of warehouse ids.
- warehouseExternalIds string? (default ()) - Returns all containers that exist in the provided warehouse. Single warehouse's external id or comma separated list of warehouse external ids.
- 'type string[]? (default ()) - Container type. Valid options are 'box', 'envelope', 'tube', 'pallet'
Return Type
postContainers![](/images/permalink.svg)
function postContainers(CreateANewContainerRequest payload) returns CreateANewContainerResponse|error
Create a new container
Parameters
- payload CreateANewContainerRequest - CreateANewContainer request
Return Type
getContainersById![](/images/permalink.svg)
function getContainersById(string id) returns GetAContainerResponse|error
Get a container
Parameters
- id string - The container's id or external id.
Return Type
putContainersById![](/images/permalink.svg)
function putContainersById(string id, UpdateAContainerRequest payload) returns UpdateAContainerResponse|error
Update a container
Parameters
- id string - The containers's id or external id.
- payload UpdateAContainerRequest - UpdateAContainer request
Return Type
Records![](/images/permalink.svg)
shipwire.containers: ClientConfig![](/images/permalink.svg)
Provides a set of configurations for controlling the behaviours when communicating with a remote HTTP endpoint.
Fields
- auth CredentialsConfig - Configurations related to client authentication
- httpVersion string(default "1.1") - The HTTP version understood by the client
- http1Settings ClientHttp1Settings(default {}) - Configurations related to HTTP/1.x protocol
- http2Settings ClientHttp2Settings(default {}) - Configurations related to HTTP/2 protocol
- timeout decimal(default 60) - The maximum time to wait (in seconds) for a response before closing the connection
- forwarded string(default "disable") - The choice of setting
forwarded
/x-forwarded
header
- followRedirects FollowRedirects?(default ()) - Configurations associated with Redirection
- poolConfig PoolConfiguration?(default ()) - Configurations associated with request pooling
- cache CacheConfig(default {}) - HTTP caching related configurations
- compression Compression(default http:COMPRESSION_AUTO) - Specifies the way of handling compression (
accept-encoding
) header
- circuitBreaker CircuitBreakerConfig?(default ()) - Configurations associated with the behaviour of the Circuit Breaker
- retryConfig RetryConfig?(default ()) - Configurations associated with retrying
- cookieConfig CookieConfig?(default ()) - Configurations associated with cookies
- responseLimits ResponseLimitConfigs(default {}) - Configurations associated with inbound response size limits
- secureSocket ClientSecureSocket?(default ()) - SSL/TLS-related options
shipwire.containers: ContainerDimensions![](/images/permalink.svg)
Container dimensions
Fields
- length decimal? - This is the length of the container based on its Unit of Measurement (lengthUnit)
- width decimal? - This is the width of the container based on its Unit of Measurement (widthUnit)
- height float? - This is the height of the container based on its Unit of Measurement (heightUnit)
- weight float? - This is the weight of the container based on its Unit of Measurement (weightUnit)
- maxWeight float? - This is the maximum weight that the container can hold based on its Unit of Measurement (maxWeightUnit)
- lengthUnit string? - This is the Unit of Measurement for Container length (e.g. inches)
- widthUnit string? - This is the Unit of Measurement for Container width (e.g. inches)
- heightUnit string? - This is the Unit of Measurement for Container height (e.g. inches)
- weightUnit string? - This is the Unit of Measurement for Container weight (e.g. pounds)
- maxWeightUnit string? - This is the Unit of Measurement for Container's max weight (e.g. pounds)
shipwire.containers: ContainerNotFound404Response![](/images/permalink.svg)
Get using invalid container Id
Fields
- Fields Included from *Get404ResponseModel
shipwire.containers: ContainerResponseModel![](/images/permalink.svg)
Container response model
Fields
- id int? - A unique auto-generated ID assigned to each new container added to the Shipwire Platform.
- externalId string? - A unique user-provided identifier for a container in an external system.
- name string? - A unique identifier for the container in the Shipwire system. It can be standardized to be the dimensions of the container (length, width, height) and type.
- 'type string? - This is the type of container based on the contents stored in it.
- isActive int? - A boolean which indicates whether or not the warehouse can use the container for a particular customer for packaging
- warehouseId int? - A unique identifier for a Shipwire or Shipwire Anywhere warehouse. (See the warehouses API.)
- warehouseExternalId string? - A unique user-provided identifier for a Shipwire Anywhere warehouse in an external system.
- basis string? - Basis is a parameter used to prioritize the use of some containers over others. To give preference to one container over another, assign a higher basis value.
- serviceSpecificCarrierCode string? - It indicates that this container is used with a particular carrier service (eg. FDX 1D).
- dimensions ContainerresponsemodelDimensions? - Dimensions
- values ContainerresponsemodelValues? - Values
shipwire.containers: ContainerresponsemodelDimensions![](/images/permalink.svg)
Dimensions
Fields
- resourceLocation string? - Resource location
- 'resource ContainerDimensions? - Container dimensions
shipwire.containers: ContainerresponsemodelValues![](/images/permalink.svg)
Values
Fields
- resourceLocation string? - Resource location
- 'resource ContainerValue? - Container value
shipwire.containers: ContainerValue![](/images/permalink.svg)
Container value
Fields
- costValue decimal? - This is the cost value for the container. During the carton selection phase for an order, Shipwire will first consider containers with a lower cost, even if chosing one will end up making the shipping cost comparatively higher. (i.e. Shipwire will chose a container 1 with a $0 cost over a container 2 with a $1 cost, even if the shipping cost for using container 1 is higher than it would be using container 2.)
- retailValue decimal? - This is the retail value for the container. Container retail value will be added to the shipping quote for the customer. If a merchant doesn't plan to charge customers for cartons/boxes, the container retail value should be set to $0.
- costValueCurrency string? - This is the currency used in determining cost value for the container.
- retailValueCurrency string? - This is the currency used in determining retail value for the container.
shipwire.containers: CreateANewContainerRequest![](/images/permalink.svg)
Request to create new container
Fields
- warehouseExternalId string? - A unique user-provided identifier for a Shipwire Anywhere warehouse in an external system.
- externalId string? - A unique user-provided identifier for a container in an external system.
- name string - A unique identifier for the container in the Shipwire system. It can be standardized to be the dimensions of the container (length, width, height) and type.
- 'type string - This is the type of container based on the contents stored in it.
- isActive int - A boolean which indicates whether or not the warehouse can use the container for a particular customer for packaging
- warehouseId int - A unique identifier for a Shipwire or Shipwire Anywhere warehouse. (See the warehouses API.)
- basis string - Basis is a parameter used to prioritize the use of some containers over others. To give preference to one container over another, assign a higher basis value.
- serviceSpecificCarrierCode string? - It indicates that this container is used with a particular carrier service (eg. FDX 1D).
- dimensions record {} - Dimensions
- values record {} - Values
shipwire.containers: CreateANewContainerResponse![](/images/permalink.svg)
Response post container creation
Fields
- Fields Included from *PutPostResponseModel
shipwire.containers: Get404ResponseModel![](/images/permalink.svg)
Fields
- status int? - This is the HTTP status code.
- message string? - This is the HTTP status message.
- resourceLocation string? - A URL that gives more information about the linked resource. A null value would mean that no further information is available for that resource.
shipwire.containers: GetAContainerResponse![](/images/permalink.svg)
Get container details
Fields
- status int? - This is the HTTP status code.
- message string? - This is the HTTP status message.
- resourceLocation string? - A URL that gives more information about the linked resource. A 'null' value would mean that no further information is available for that resource.
- 'resource ContainerResponseModel? - Container response model
shipwire.containers: GetContainersResponse![](/images/permalink.svg)
Get container details
Fields
- Fields Included from *GetResponseModel
shipwire.containers: GetResponseModel![](/images/permalink.svg)
Fields
- status int? - This is the HTTP status code.
- message string? - This is the HTTP status message.
- resourceLocation string? - A URL that gives more information about the linked resource. A null value would mean that no further information is available for that resource.
shipwire.containers: PutPostResponseModel![](/images/permalink.svg)
Fields
- status int? - This is the HTTP status code.
- message string? - This is the HTTP status message.
- warnings record {}? - A notification that warns the user of something or that serves as a caution. Eg. an externalId supplied greater than 32 characters.
- errors record {}? - A fatal error that prevents the user from performing some action. (e.g. invalid warehouseId specified when creating a container)
- resourceLocation string? - A URL that gives more information about the linked resource. A null value would mean that no further information is available for that resource.
shipwire.containers: UpdateAContainerRequest![](/images/permalink.svg)
Request to update container information
Fields
- warehouseExternalId string? - A unique user-provided identifier for a Shipwire Anywhere warehouse in an external system.
- externalId string? - A unique user-provided identifier for a container in an external system.
- name string - A unique identifier for the container in the Shipwire system. It can be standardized to be the dimensions of the container (length, width, height) and type.
- 'type string - This is the type of container based on the contents stored in it.
- isActive int - A boolean which indicates whether or not the warehouse can use the container for a particular customer for packaging
- warehouseId int - A unique identifier for a Shipwire or Shipwire Anywhere warehouse. (See the warehouses API.)
- basis string - Basis is a parameter used to prioritize the use of some containers over others. To give preference to one container over another, assign a higher basis value.
- serviceSpecificCarrierCode string? - It indicates that this container is used with a particular carrier service (eg. FDX 1D).
- dimensions record {} - Dimensions
- values record {} - Values
shipwire.containers: UpdateAContainerResponse![](/images/permalink.svg)
Response for container update
Fields
- Fields Included from *PutPostResponseModel
Import
import ballerinax/shipwire.containers;
Metadata
Released date: over 2 years ago
Version: 1.1.0
License: Apache-2.0
Compatibility
Platform: any
Ballerina version: slbeta6
GraalVM compatible: Yes
Pull count
Total: 0
Current verison: 0
Weekly downloads
Keywords
Commerce/eCommerce
Cost/Freemium
Contributors
Dependencies