Label Transformations
Transformation
A transformation
modifies the label returned by the shipping carrier.
To add a transformation include the label
parameter and add a transformation
:
field | type | values |
---|---|---|
type | string | add_image, add_text, flip_180 |
data | string | base64 encoded jpg,gif,png data |
starting_x | int | horizontal position on label to place image |
starting_y | int | vertical position on label to place image |
font_height | int | height of font for add_text |
font_width | int | width of font for add_text |
Transformation Types:
add_image
- Adds an image to the label (typically used to add logos)add_text
- Adds text to a labelflip_180
- Flips the label 180 degrees (typically used for print orientation when carriers lack API native support)flip_90
- Flips the label 90 degrees (typically used for print orientation when carriers lack API native support) ZPL/EPL not currently supported
Supported Carriers:
- UPS
- FedEx
- Stamps.com
Your carrier not supported? Just ask and we will add it.
Examples
Add text to your label (only ZPL/EPL labels supported):
...
"label": {
"transformations": [
{
"type": "add_text",
"data": "your custom text!",
"starting_x": 265,
"starting_y": 25,
"font_height": 12,
"font_width": 10
}
]
},
...
Add an image to your label:
...
"label": {
"transformations": [
{
"type": "add_image",
"image": "iVBORw0KGgoA...",
"starting_x": 265,
"starting_y": 25
}
]
},
...
See also: Add a logo to the shipping label
Flip the label 180 degrees:
...
"label": {
"transformations": [
{
"type": "flip_180"
}
]
},
...