FedEx - Create Shipment / Label
Description
Section titled “Description”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.
Configuration
Section titled “Configuration”| Parameter | Type | Required | Description |
|---|---|---|---|
| credentials_id | credentials | Yes | FedEx credential (provider: fedex) |
| shipper | textarea | Yes | Shipper data in JSON with personName, phoneNumber, and address |
| recipient | textarea | Yes | Recipient data in JSON |
| service_type | select | Yes | Service type: FEDEX_INTERNATIONAL_PRIORITY, FEDEX_INTERNATIONAL_ECONOMY, FEDEX_GROUND, FEDEX_EXPRESS_SAVER, STANDARD_OVERNIGHT |
| package_weight | text | Yes | Package weight in kilograms |
| package_dimensions | textarea | No | Package dimensions in JSON (length, width, height) |
| label_type | select | No | Label format: PDF (default), PNG, ZPLII |
| reference | text | No | Internal shipment reference |
Credentials
Section titled “Credentials”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/).
Output
Section titled “Output”{ "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"}Usage Example
Section titled “Usage Example”Basic case
Section titled “Basic case”{ "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"}API Used
Section titled “API Used”- Endpoint: POST
/ship/v1/shipments - Base: FedEx API (via helper
_fedexHelper) - Documentation: https://developer.fedex.com/api/en-us/catalog.html
- 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