Overview
The ShipStation API v2 integration provides ready-made functions you can call when building mappings. They handle the common lookups a ShipStation order and its tracking records need: resolving the ShipStation ID of a warehouse, carrier, carrier service or LTL freight provider account from a name you know, and resolving the iPaaS.com shipping method name for a ShipStation carrier service. You do not have to write those lookups yourself in a formula.
Where you can use these functions
These functions are available anywhere you write a formula for the ShipStation API v2 integration:
Dynamic Formula mappings: where a destination field's value is produced by a formula rather than mapped directly from a source field.
Mapping collection filters: where a formula decides whether a record should be processed.
Error filters: a mapping collection's error filter, which sits alongside its collection filter. When the error filter's formula resolves to true, the transfer raises an error that is held in the Error Logs for review and is not retried automatically.
Translation collections: where a translation entry uses a formula as its source value.
How to use them
Call a function by name and pass the values it needs in parentheses, for example:
await GetWarehouseIdByNameAsync("Atlanta DC").Each function's signature shows its name, the parameters it accepts (with their types), and the type of value it returns. Use it as the reference for exactly how to call the function.
Function names and formula syntax are case-sensitive, so type each name exactly as shown. Whether the values a function matches are treated as case-sensitive varies by function, and is called out in the relevant parameter's description.
Every function that returns a
Taskis asynchronous and must be called withawait, as shown in each How to call it example.Each function runs at sync time, against the data in your connected ShipStation account and your iPaaS.com subscription. Each lookup result is kept for 60 seconds, so an order with many destinations looks a warehouse or carrier up once rather than once per destination. Saved ShipStation results are tied to the subscription's API Url and API Key, so subscriptions connected to different ShipStation accounts never share them.
The functions are grouped below by the area of the integration they support.
Orders: Warehouses
GetWarehouseIdByNameAsync
What it does: Looks up the ID of the ShipStation warehouse (ship-from location) with a given name, for the order's Warehouse Id field.
Signature: Task<string> GetWarehouseIdByNameAsync(string name)
How to call it: await GetWarehouseIdByNameAsync(name)
Parameter | Type | Required | Default | Description |
|
| Yes | N/A | The warehouse's name in ShipStation, for example the value of the iPaaS.com transaction's ShipStation Ship From Location custom field. The match is not case-sensitive and ignores leading and trailing spaces. |
Returns: string. The ShipStation warehouse ID (for example se-1234567), or null when the name is blank, in which case the order uses the ShipStation account's default warehouse. When no ShipStation warehouse has the name, the function returns a marker instead of null, and the integration refuses the order with error SSV2-VALD-1006, so a mistyped name never ships from the default warehouse.
Example: "Atlanta DC" returns "se-1234567".
When to use it: Use it on the Warehouse Id mapping of the Order or Order Address collection, so the order source can name the warehouse instead of knowing its ShipStation ID. The default templates do this, reading the ShipStation Ship From Location custom field. Use the name exactly as ShipStation shows it (case and surrounding spaces do not matter), or leave it blank to use the default warehouse.
Orders: Carriers and Services
GetCarrierIdByServiceNameAsync
What it does: Finds the ShipStation carrier account that offers a given carrier service, for the order's Carrier Id field.
Signature: Task<string> GetCarrierIdByServiceNameAsync(string serviceNameOrCode)
How to call it: await GetCarrierIdByServiceNameAsync(serviceNameOrCode)
Parameter | Type | Required | Default | Description |
|
| Yes | N/A | A ShipStation service name such as |
Returns: string. The ShipStation carrier ID (for example se-734101), or null when the value is blank or no carrier connected to your ShipStation account offers that service.
Example: "FedEx Ground®" returns "se-734101".
When to use it: Use it to preselect the carrier on the ShipStation order from the shipping method on the iPaaS.com transaction. Pair it with GetServiceCodeByServiceNameAsync to set both the carrier and the service. If two connected carrier accounts offer the same service, the first one in ShipStation's carrier list is used.
GetServiceCodeByServiceNameAsync
What it does: Looks up the ShipStation service code for a carrier service name, for the order's Service Code field.
Signature: Task<string> GetServiceCodeByServiceNameAsync(string serviceNameOrCode)
How to call it: await GetServiceCodeByServiceNameAsync(serviceNameOrCode)
Parameter | Type | Required | Default | Description |
|
| Yes | N/A | A ShipStation service name such as |
Returns: string. The ShipStation service code, or null when the value is blank or no carrier connected to your ShipStation account offers that service.
Example: "FedEx Ground®" returns "fedex_ground".
When to use it: Use it with GetCarrierIdByServiceNameAsync to preselect both the carrier and the service on the ShipStation order. Both functions share one read of your ShipStation carriers.
Orders: LTL Freight
GetFreightProviderAccountIdAsync
What it does: Looks up the ID of a ShipStation LTL freight provider account by its nickname or provider code, for the order's Freight Provider Account field.
Signature: Task<string> GetFreightProviderAccountIdAsync(string nameOrProvider)
How to call it: await GetFreightProviderAccountIdAsync(nameOrProvider)
Parameter | Type | Required | Default | Description |
|
| Yes | N/A | The freight provider account's nickname in ShipStation, or its provider code, for example |
Returns: string. The ShipStation freight provider account ID (for example se-4821), or null when the value is blank or no freight provider account connected to your ShipStation account matches.
Example: "UNISHIPPERS" returns "se-4821".
When to use it: Use it when different orders use different LTL freight providers, or when you know the provider but not its account ID. When the order's Freight Provider Account is left blank, the subscription's Freight Provider Account setting is used.
Shipment Tracking
GetShippingMethodNameAsync
What it does: Returns the name of the iPaaS.com shipping method linked to a ShipStation carrier service, for a tracking record's Shipping Method field. iPaaS.com requires that field to match the name of a configured shipping method, so a raw carrier code such as fedex is refused.
Signature: Task<string> GetShippingMethodNameAsync(object shippingMethodId)
How to call it: await GetShippingMethodNameAsync(ShippingMethodId)
Parameter | Type | Required | Default | Description |
|
| Yes | N/A | The ShipStation carrier service on the tracking record, as the ShipStation carrier code and service code separated by a pipe character, or the fixed LTL freight value (see Example below). On the Shipment Tracking collection, pass the ShippingMethodId field. Leading and trailing spaces are ignored. |
Returns: string. The name of the iPaaS.com shipping method (for example FedEx Ground®), or null when the value is blank or that ShipStation service has not been brought into iPaaS.com yet.
Example: fedex|fedex_ground returns "FedEx Ground®", and freight|ltl returns "LTL Freight (ShipStation)".
When to use it: The default Shipment Tracking template uses it on the Shipping Method mapping and keeps the record's existing value when it returns null. Run the Shipping Method TO iPaaS.com initialization first, so every ShipStation carrier service (and LTL Freight (ShipStation)) exists in iPaaS.com and is linked to its ShipStation service; otherwise the function finds nothing and a new tracking record can be refused. Unlike the other functions, it reads your iPaaS.com subscription rather than ShipStation.
