Skip to content

FedEx - Create Shipment / Label

This module creates a shipment in FedEx through the Ship v1 API. It receives the shipper and recipient data in JSON format, service type, package weight, optional dimensions, label format, and reference. It builds the complete payload with account configuration, label specification, and package lines. It makes a POST request to the /ship/v1/shipments endpoint and returns the tracking number, shipment ID, label URL, service type, and status.

ParameterTypeRequiredDescription
credentials_idcredentialsYesFedEx credential (provider: fedex)
shippertextareaYesShipper data in JSON with personName, phoneNumber, and address
recipienttextareaYesRecipient data in JSON
service_typeselectYesService type: FEDEX_INTERNATIONAL_PRIORITY, FEDEX_INTERNATIONAL_ECONOMY, FEDEX_GROUND, FEDEX_EXPRESS_SAVER, STANDARD_OVERNIGHT
package_weighttextYesPackage weight in kilograms
package_dimensionstextareaNoPackage dimensions in JSON (length, width, height)
label_typeselectNoLabel format: PDF (default), PNG, ZPLII
referencetextNoInternal shipment reference

A fedex type credential is required with the following fields:

  • client_id: FedEx API Client ID
  • client_secret: FedEx API Client Secret
  • account_number: FedEx account number

Credentials are obtained from the FedEx Developer Portal (https://developer.fedex.com/).

{
"success": true,
"tracking_number": "794644790138",
"shipment_id": "SHIP-001",
"label_url": "https://fedex.com/labels/...",
"service_type": "FEDEX_INTERNATIONAL_PRIORITY",
"status": "CREATED",
"message": "Envio FedEx creado - Tracking: 794644790138"
}
{
"credentials_id": "mi_credencial_fedex",
"shipper": "{\"personName\":\"Mi Empresa\",\"phoneNumber\":\"+34600000000\",\"address\":{\"streetLines\":[\"Calle Gran Via 1\"],\"city\":\"Madrid\",\"stateOrProvinceCode\":\"MD\",\"postalCode\":\"28001\",\"countryCode\":\"ES\"}}",
"recipient": "{\"personName\":\"Cliente\",\"phoneNumber\":\"+34600000001\",\"address\":{\"streetLines\":[\"Av Diagonal 100\"],\"city\":\"Barcelona\",\"stateOrProvinceCode\":\"CT\",\"postalCode\":\"08001\",\"countryCode\":\"ES\"}}",
"service_type": "FEDEX_INTERNATIONAL_PRIORITY",
"package_weight": "3.0",
"label_type": "PDF"
}
  • Authentication uses OAuth2 with client_id and client_secret
  • The packaging type is set to YOUR_PACKAGING by default
  • The pickup type is set to DROPOFF_AT_FEDEX_LOCATION
  • The label size is PAPER_4X6
  • If a reference is included, it is added as CUSTOMER_REFERENCE in the package
  • Dimensions are optional and expressed in centimeters