shipwire.containers
Module shipwire.containers
Definitions
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
shipwire.containers: Client
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
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 (ConnectionConfig config, string serviceUrl)
- config ConnectionConfig - The configurations to be used when initializing the
connector
- serviceUrl string "https://api.shipwire.com/" - URL of the target service
getContainers
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
function postContainers(CreateANewContainerRequest payload) returns CreateANewContainerResponse|error
Create a new container
Parameters
- payload CreateANewContainerRequest - CreateANewContainer request
Return Type
getContainersById
function getContainersById(string id) returns GetAContainerResponse|error
Get a container
Parameters
- id string - The container's id or external id.
Return Type
putContainersById
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
shipwire.containers: ClientHttp1Settings
Provides settings related to HTTP/1.x protocol.
Fields
- keepAlive KeepAlive(default http:KEEPALIVE_AUTO) - Specifies whether to reuse a connection for multiple requests
- chunking Chunking(default http:CHUNKING_AUTO) - The chunking behaviour of the request
- proxy ProxyConfig? - Proxy server related options
shipwire.containers: ConnectionConfig
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 HttpVersion(default http:HTTP_2_0) - The HTTP version understood by the client
- http1Settings ClientHttp1Settings? - Configurations related to HTTP/1.x protocol
- http2Settings ClientHttp2Settings? - 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
- poolConfig PoolConfiguration? - Configurations associated with request pooling
- cache CacheConfig? - HTTP caching related configurations
- compression Compression(default http:COMPRESSION_AUTO) - Specifies the way of handling compression (
accept-encoding
) header
- circuitBreaker CircuitBreakerConfig? - Configurations associated with the behaviour of the Circuit Breaker
- retryConfig RetryConfig? - Configurations associated with retrying
- responseLimits ResponseLimitConfigs? - Configurations associated with inbound response size limits
- secureSocket ClientSecureSocket? - SSL/TLS-related options
- proxy ProxyConfig? - Proxy server related options
- validation boolean(default true) - Enables the inbound payload validation functionality which provided by the constraint package. Enabled by default
shipwire.containers: ContainerDimensions
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
Get using invalid container Id
Fields
- Fields Included from *Get404ResponseModel
shipwire.containers: ContainerResponseModel
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
Dimensions
Fields
- resourceLocation string? - Resource location
- 'resource ContainerDimensions? - Container dimensions
shipwire.containers: ContainerresponsemodelValues
Values
Fields
- resourceLocation string? - Resource location
- 'resource ContainerValue? - Container value
shipwire.containers: ContainerValue
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
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
Response post container creation
Fields
- Fields Included from *PutPostResponseModel
shipwire.containers: Get404ResponseModel
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
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
Get container details
Fields
- Fields Included from *GetResponseModel
shipwire.containers: GetResponseModel
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: ProxyConfig
Proxy server configurations to be used with the HTTP client endpoint.
Fields
- host string(default "") - Host name of the proxy server
- port int(default 0) - Proxy server port
- userName string(default "") - Proxy server username
- password string(default "") - Proxy server password
shipwire.containers: PutPostResponseModel
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
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
Response for container update
Fields
- Fields Included from *PutPostResponseModel
Import
import ballerinax/shipwire.containers;
Metadata
Released date: over 1 year ago
Version: 1.5.1
License: Apache-2.0
Compatibility
Platform: any
Ballerina version: 2201.4.1
GraalVM compatible: Yes
Pull count
Total: 1
Current verison: 1
Weekly downloads
Keywords
Commerce/eCommerce
Cost/Freemium
Contributors