Rate request
- Label API
- REST
- Get a rate for a shipment
FirstMile Label Server REST API (1.0)
The FirstMile Label Server REST API provides endpoints for label creation, rate shopping, meter management, and manifesting shipments. This API replaces the legacy SOAP interface. All endpoints, request/response models, and business logic are documented here, with migration notes for users transitioning from SOAP.
The API uses OAuth 2.0 Bearer token authentication with policy-based authorization:
- Label operations require 'fm.external.rest.labelserver.label' scope
- Rate operations require 'fm.external.rest.labelserver.rate' scope
- Meter operations require 'fm.external.rest.labelserver.meter' scope
The API validates claims including 'fm.api.companyId' (IFS ID) and 'fm.api.techPartnerId'.
https://developer.fastgroup.co/_mock/xmethod/label/rest/swagger/
https://labelserver-test.firstmile.com/
https://labelserver.firstmile.com/
Available shipping services
Package(s) information. Multi-package shipments are only supported for FedEx, UPS, and DHL Express shipments. (SOAP: PackageDetail)
International customs duties terms
USPS ancillary service endorsement
USPS ancillary service endorsement
These values are added to the label image when possible. (SOAP: DocTabValues)
Scheduled shipment date (if not immediate). (SOAP: FutureShipmentDate)
Label image format
- Mock server
https://developer.fastgroup.co/_mock/xmethod/label/rest/swagger/api/v1/rate
- Test server
https://labelserver-test.firstmile.com/api/v1/rate
- Production server
https://labelserver.firstmile.com/api/v1/rate
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X POST \
https://developer.fastgroup.co/_mock/xmethod/label/rest/swagger/api/v1/rate \
-H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
-H 'Content-Type: application/json' \
-d '{
"techPartnerId": "string",
"fromAddress": {
"companyName": "string",
"name": "string",
"address1": "string",
"address2": "string",
"address3": "string",
"city": "string",
"state": "string",
"postalCode": "string",
"country": "string",
"email": "string",
"phoneNumber": "string",
"residential": false
},
"toAddress": {
"companyName": "string",
"name": "string",
"address1": "string",
"address2": "string",
"address3": "string",
"city": "string",
"state": "string",
"postalCode": "string",
"country": "string",
"email": "string",
"phoneNumber": "string",
"residential": false
},
"shippingServiceEnum": "Unknown",
"shippingService": "string",
"packages": [
{
"weight": {
"weightOz": 0,
"weightType": "Actual"
},
"packageDimensions": {
"lengthInch": 0,
"widthInch": 0,
"heightInch": 0
},
"specialServices": {
"dangerousGoodsOptions": {
"dangerousGoodsType": "None",
"emergencyContactNumber": "string"
},
"signatureType": "None"
},
"packageDescription": "string",
"packageValue": 0
}
],
"requestId": "string",
"customsData": {
"shipmentValue": 0,
"shipmentDescription": "string",
"customsItems": [
{
"countryOfOrigin": "string",
"description": "string",
"itemValue": 0,
"itemQuantity": 0,
"itemSKU": "string",
"hsCode": "string",
"itemWeight": {
"weightOz": 0,
"weightType": "Actual"
},
"itemDescriptionInExportCountryLanguage": "string"
}
]
},
"internationalDutyTermsEnum": "Unknown",
"internationalDutyTerms": "string",
"ancillaryEndorsementEnum": "None",
"ancillaryEndorsement": "string",
"secondaryEndorsementEnum": "None",
"secondaryEndorsement": "string",
"docTabValues": [
"string"
],
"futureShipmentDate": "2019-08-24T14:15:22Z",
"labelImageFormatEnum": "Unknown",
"labelImageFormat": "string",
"labelImageSizeEnum": "Label4X6",
"shipmentWeightOz": 0,
"reference1": "string",
"reference2": "string",
"orderNumber": "string"
}'OK - Rate calculated successfully
Warning information. These are for information purposes only, they are not errors.
Available shipping services
{ "requestId": "string", "errors": [ "string" ], "warnings": [ "string" ], "estimatedZone": "string", "weight": { "weightOz": 0, "weightType": "Actual" }, "packageRates": [ { … } ], "shippingService": "Unknown", "daysInTransit": 0 }
Rate shop request
Available shipping services
Package(s) information. Multi-package shipments are only supported for FedEx, UPS, and DHL Express shipments. (SOAP: PackageDetail)
International customs duties terms
USPS ancillary service endorsement
USPS ancillary service endorsement
These values are added to the label image when possible. (SOAP: DocTabValues)
Scheduled shipment date (if not immediate). (SOAP: FutureShipmentDate)
Label image format
- Mock server
https://developer.fastgroup.co/_mock/xmethod/label/rest/swagger/api/v1/rate/shop
- Test server
https://labelserver-test.firstmile.com/api/v1/rate/shop
- Production server
https://labelserver.firstmile.com/api/v1/rate/shop
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X POST \
https://developer.fastgroup.co/_mock/xmethod/label/rest/swagger/api/v1/rate/shop \
-H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
-H 'Content-Type: application/json' \
-d '{
"techPartnerId": "string",
"fromAddress": {
"companyName": "string",
"name": "string",
"address1": "string",
"address2": "string",
"address3": "string",
"city": "string",
"state": "string",
"postalCode": "string",
"country": "string",
"email": "string",
"phoneNumber": "string",
"residential": false
},
"toAddress": {
"companyName": "string",
"name": "string",
"address1": "string",
"address2": "string",
"address3": "string",
"city": "string",
"state": "string",
"postalCode": "string",
"country": "string",
"email": "string",
"phoneNumber": "string",
"residential": false
},
"shippingServiceEnum": "Unknown",
"shippingService": "string",
"packages": [
{
"weight": {
"weightOz": 0,
"weightType": "Actual"
},
"packageDimensions": {
"lengthInch": 0,
"widthInch": 0,
"heightInch": 0
},
"specialServices": {
"dangerousGoodsOptions": {
"dangerousGoodsType": "None",
"emergencyContactNumber": "string"
},
"signatureType": "None"
},
"packageDescription": "string",
"packageValue": 0
}
],
"requestId": "string",
"customsData": {
"shipmentValue": 0,
"shipmentDescription": "string",
"customsItems": [
{
"countryOfOrigin": "string",
"description": "string",
"itemValue": 0,
"itemQuantity": 0,
"itemSKU": "string",
"hsCode": "string",
"itemWeight": {
"weightOz": 0,
"weightType": "Actual"
},
"itemDescriptionInExportCountryLanguage": "string"
}
]
},
"internationalDutyTermsEnum": "Unknown",
"internationalDutyTerms": "string",
"ancillaryEndorsementEnum": "None",
"ancillaryEndorsement": "string",
"secondaryEndorsementEnum": "None",
"secondaryEndorsement": "string",
"docTabValues": [
"string"
],
"futureShipmentDate": "2019-08-24T14:15:22Z",
"labelImageFormatEnum": "Unknown",
"labelImageFormat": "string",
"labelImageSizeEnum": "Label4X6",
"shipmentWeightOz": 0,
"reference1": "string",
"reference2": "string",
"orderNumber": "string"
}'{ "requestId": "string", "errors": [ "string" ], "warnings": [ "string" ], "rates": [] }