> For the complete documentation index, see [llms.txt](https://apidocs.gsped.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://apidocs.gsped.com/gsped-api-english-version/spedizioni-e-dintorni/shipment/corrieri/fedex.md). Agents can also search and read this documentation through its [MCP server](https://apidocs.gsped.com/~gitbook/mcp).

# FedEx

## Courier field limitations

| Field               | Limitation  |
| ------------------- | ----------- |
| ddt\_alpha          | Max 40 char |
| rcpt\_addr          | Max 35 char |
| rcpt\_cap           | Max 10 char |
| rcpt\_city          | Max 30 char |
| rcpt\_country\_code | Max 2 char  |
| rcpt\_name          | Max 35 char |
| rcpt\_prov          | Max 2 char  |

## Gsped code list

<table data-full-width="true"><thead><tr><th>Service</th><th data-type="number">Courier code</th><th data-type="number">Service code</th><th>addParcel (pasgo)</th><th>Notes</th></tr></thead><tbody><tr><td>Priority Overnight</td><td>20</td><td>0</td><td>true</td><td>Domestic</td></tr><tr><td>First</td><td>20</td><td>1</td><td>true</td><td>Domestic</td></tr><tr><td>Priority Express</td><td>20</td><td>2</td><td>true</td><td>Domestic</td></tr><tr><td>Priority</td><td>20</td><td>3</td><td>true</td><td>Domestic</td></tr><tr><td>Priority Express Freight</td><td>20</td><td>4</td><td>true</td><td>Domestic</td></tr><tr><td>Priority Freight</td><td>20</td><td>5</td><td>true</td><td>Domestic</td></tr><tr><td>International Priority Express</td><td>20</td><td>6</td><td>true</td><td>International</td></tr><tr><td>International Priority Freight</td><td>20</td><td>7</td><td>false</td><td>International</td></tr><tr><td>International Priority</td><td>20</td><td>8</td><td>true</td><td>International</td></tr><tr><td>International Connect Plus</td><td>20</td><td>9</td><td>true</td><td>International</td></tr><tr><td>International Economy</td><td>20</td><td>10</td><td>true</td><td>International</td></tr><tr><td>International Economy Freight</td><td>20</td><td>11</td><td>false</td><td>International</td></tr><tr><td>International First</td><td>20</td><td>12</td><td>false</td><td>International</td></tr><tr><td>Regional Economy</td><td>20</td><td>16</td><td>true</td><td>International</td></tr><tr><td>Regional Economy Freight</td><td>20</td><td>17</td><td>true</td><td>International</td></tr><tr><td>International Deferred Freight</td><td>20</td><td>19</td><td>false</td><td>international</td></tr></tbody></table>

## ICS2

For non-domestic shipments the courier requires the following to be set:

* [dettagli\_ordine](https://apidocs.gsped.com/gsped-api-english-version/spedizioni-e-dintorni/shipment/shipment-objects/dettagli_ordine)
* Optional: invoice\_number

## Sender and recipient email

FedEx is introducing a requirement for the sender and recipient email on international shipments. We recommend always setting `sender_email` and `rcpt_email`.

If `sender_email` is not set, Gsped sends FedEx the operational email configured in the customer profile, if it is a valid address.

If one of the two emails is missing on an international shipment, the shipment is created and the response contains a notice in the `warnings` field, which is always present in the shipment responses and lists the notices that do not block the shipment.

```json
"warnings": [
    {
        "code": "RCPT_EMAIL_MISSING",
        "row": null,
        "sku": null,
        "message": "Description of the notice"
    }
]
```

| Code                   | Description                                                                   |
| ---------------------- | ----------------------------------------------------------------------------- |
| RCPT\_EMAIL\_MISSING   | The recipient email is missing                                                |
| SENDER\_EMAIL\_MISSING | The sender email is missing, both on the shipment and in the customer profile |

{% hint style="info" %}
The notice does not block the shipment: the outcome of the creation is still given by the `status` field.
{% endhint %}

## [Trade documents](https://apidocs.gsped.com/gsped-api-english-version/spedizioni-e-dintorni/shipment/shipment-objects/trade_documents)

**Available in calls: POST and PATCH**

```json
"trade_documents":[
    {
        "nome":"COMMERCIAL_INVOICE_TESTRIF1234_1.pdf",
        "contenuto":""
    }
]
```

## Export Compliance Statement

This field lets you enter an AES number/statement, allowing the user to confirm shipments from the US abroad with a customs value above 2500 dollars.

```json
"fedexrest": {
        "exportComplianceStatement": "AES X20240115123456"
}
```

### Shipment to a residential area

You can tell FedEx that you are shipping to a residential address

```json
"rcpt_residential" : 1
```

### Recipient identifier for customs

Field used to pass FedEx a sender identifier for customs shipments

```json
"fedexrest": {
    "recipientCustomsId": {
            "type": "PASSPORT",
            "value": 12345678
        }
    }
```

The possible type values and their corresponding value are the following:

| type       | value                       |
| ---------- | --------------------------- |
| PASSPORT   | Recipient's passport number |
| INDIVIDUAL | Recipient's tax code        |
| COMPANY    | Recipient's VAT number      |

### Forcing tins for the shipper

```json
"fedexrest": {
    "shipper": {
        "tins": {
            "tinType": "BUSINESS_UNION",
            "number": "IT12345678901"
        }
    }
}
```

Possible values for tinType:

* BUSINESS\_NATIONAL
* BUSINESS\_STATE
* BUSINESS\_UNION
* PERSONAL\_NATIONAL
* PERSONAL\_STATE

{% hint style="warning" %}
**WARNING!**

This parameter overrides any EORI configured for the sender
{% endhint %}

### Forcing rateRequestType

```json
"fedexrest": {
    "rateRequestType": "ACCOUNT"
}
```

Possible values:

* LIST
* INCENTIVE
* ACCOUNT
* PREFERRED
* RETAIL

Default: ACCOUNT

### dangerousGoods details

```json
"fedexrest": {
    "dangerousGoodsDetail": {
        "accessibility": "ACCESSIBLE",
        "cargoAircraftOnly": true
    }
}
```

Possible values:

| field             | values                  |
| ----------------- | ----------------------- |
| accessibility     | ACCESSIBLE/INACCESSIBLE |
| cargoAircraftOnly | true/false              |

### Booking confirmation number (Freight services)

The `fedex_booking_confirmation` field lets you pass FedEx the booking confirmation number provided by the courier for shipments with Freight services.

The field is not enabled by default: to use it, contact Gsped support.

```json
"fedex_booking_confirmation": "123456789"
```

## Document handling

For some destinations you must attach customs documents to the shipment.

#### Uploading electronic documents when creating the shipment

The preferred solution, whenever possible, is to add the trade\_documents section to the shipment POST

#### Uploading electronic documents later

If you want to attach the electronic documents later, you can do so by adding the following parameter in the Shipment POST.

See the dedicated page here:

{% content-ref url="<https://apidocs.gsped.com/gsped-api-english-version/spedizioni-e-dintorni/shipment/shipment-objects/courierdata/uploaddocafterwards>" %}
<https://apidocs.gsped.com/gsped-api-english-version/spedizioni-e-dintorni/shipment/shipment-objects/courierdata/uploaddocafterwards>
{% endcontent-ref %}

With this parameter, if ETDs are required the shipment is created anyway, but you absolutely must upload the documents through the shipment PATCH. Without uploading the documents, the goods may be held at customs.

{% hint style="danger" %}
Old deprecated method:

```
"fedexrest": {
        "willUploadDocAfterShipment": true
}
```

{% endhint %}

#### Adding documents in paper format

Not recommended, but if unavoidable contact support to enable the feature.

{% hint style="danger" %}
**Warning!!!**

With ***pasgo*** mode active, uploading the document later ( ***uploadDocAfterWards*** ) is implicit, so it is **ALWAYS** the client's responsibility to upload the electronic documents for the destinations that require them **BEFORE** confirming the shipment.
{% endhint %}
