AZLabels Home

AZLabels Support Center

Search for articles on our help desk

Printing via API

RA
Roko Alavanja
Updated 3 years ago

To connect with the printing API, you first need to create an API token from the API tab in your account settings.

Overview

The API has three methods for printing FNSKU, Generic, and Shipping labels. The labels will be generated based on the configured label size in your account. See the label size section to update your configured label size.

Base URL: https://api.azlabels.com

The API can accept either JSON or Form Data. When sending JSON, you should set your headers as follows:

Content-Type: application/json 
Accept: application/json

Authentication

To authenticate with the API, pass your token as a JSON parameter in every request that you make:

token: YOUR_API_TOKEN

Invalid tokens will receive a 401 response.

Label Limits

When you reach your label limit, you will receive a 401 response with the following JSON for FNSKU prints:

{"message": "To continue printing, you will need to upgrade your plan on the AZLabels dashboard. You have used all your available FNSKU prints for this month."}     

and for shipping label prints:

{"message": "To continue printing, you will need to upgrade your plan on the AZLabels dashboard. You have used all your available shipping label prints for this month."}     

On print responses (once a label has been generated and the label URLs returned), a labels_remaining parameter is returned containing the labels remaining in the current billing cycle.

FNSKU Labels

Endpoint: /fnskuv2 
Method: POST

The FNSKU endpoint accepts an array of labels, formatted as follows: 

labels: [    
    {        
        fnsku: 'X001339AD5',        
        title: 'Pascall Pineapple Lumps 185g',        
        condition: 'New',        
        msku: 'ABC-1234',        
        expiration_date: '01-31-2022',    
    }, 
]
ParameterRequiredFormatNotes
fnskuYesAlphanumeric string, 10 characters

titleYesString

conditionYesString, maximum 30 characters

mskuNoString, maximum 40 charactersThe MSKU will not be added to the label unless that option is enabled in the user's advanced settings
expiration_dateNoDate, formatted: MM-DD-YYYY
The expiration date requires a minimum label size of 4x2"

Amazon Shipping Labels

Endpoint: /shipAmazon 
Method: POST

The Amazon shipping labels endpoint requires you to pass in the Amazon shipping label PDF that Amazon generates. That PDF will then be converted into a thermal label format. If you receive a 202 response, see the Check Results section.

ParameterRequiredFormatNotes
labelTypeYesAlphanumeric string, must be in a list of accepted types
To get the labelType parameter, inspect the dropdown of label types that Amazon provides before you generate the label. The value of the option you select is the labelType, for example, "PackageLabel_Letter_2"
pdfYesFile
The PDF file that Amazon generates

Check Results

Endpoint: /check 
Method: POST
If you receive a 202 response for any of the generation endpoints, that means the label generation job was queued for processing and you will need to poll the /check endpoint. Once this endpoint returns a 200 response, you will receive the link to the completed labels. If the job is not yet ready, it will return a 202 response.

ParameterRequiredFormatNotes
hash
YesAlphanumeric string
This is the hash that was returned from a previous call to a generation endpoint.

Generic Labels

More details on the types of generic labels available can found here: https://azlabels.helpscoutdocs.com/article/20-print-generic-labels

Endpoint: /generic 
Method: POST
ParameterRequiredFormatNotes
typeYesString, must be in list of types
Types available: bb-date, expiry-date, fragile,set, set-no-separate, ready-ship, single-item, suffocation, team-lift, mech-lift, caution-heavy, small-light, review-request, glue-pen
quantity
YesInteger, Min 1, Max 1,000

day
NoNumeric, Min 1, Max 31
If set, the day will be added to label types with dates
month
SometimesNumeric, Min 1, Max 12
The month is required for any of the following label types: bb-date, expiry-date
yearSometimes
Numeric, Min 2017, Max 3000
The year is required for any of the following label types: bb-date, expiry-date
date-formatNoString, must be either "int" or "us"
"int" will put the day before the month (DD/MM/YYYY), and "us" will put the month before the day (MM/DD/YYYY). Defaults to "int".

Label Sizes

To set the label size on your account, you will be using a different API endpoint and authentication parameter.
Base URL: https://dashboard.azlabels.com/api

The API can accept either JSON or Form Data. When sending JSON, you should set your headers as follows:

Content-Type: application/json 
Accept: application/json 

Authentication

To authenticate with the API, pass your token as a parameter in every request that you make:

api_token: YOUR_API_TOKEN

Invalid tokens will receive a 401 response.

Index

Endpoint: /label-sizes Method: GET

Get the available label sizes to know the label size ID to pass in the update request.

ParameterRequiredFormatNotes
typeNo"fnsku" or "shipping"

Update

Endpoint: /label-sizes Method: POST
Update the label size configured on your account, using the ID of the label size found in the Index request.
ParameterRequiredFormatNotes
fnsku_label_size_idRequired without shipping_label_size_id
integer

shipping_label_size_idRequired without fnsku_label_size_idinteger
Did this answer your question?
😞 😐 😃