# Porting in France

Porting in France refers to the process of switching carrier while keeping an existing phone number. There are a few concepts that you should be aware of throughout the porting process:

* **Donor provider:** The carrier that currently owns the number and will lose it once the porting is completed (the user's current provider).
* **Recipient provider:** The carrier that will receive the number once the porting is completed (managed through Gigs).
* **RIO:** The RIO (Relevé d'Identité Opérateur) is a unique code that identifies the user's contract with the donor provider and allows the recipient provider to request the port. It always has 12 characters: a two-character operator code, a `P` (individual) or `E` (business), a six-character contract reference and a three-character control key, e.g. 12PABC123XYZ. The user obtains it by calling 3179 from the line to be ported: the RIO is read out and then sent by SMS. Requesting a RIO does not cancel the user's current contract, and the RIO stays the same for the lifetime of that contract.
* **Porting authority:** In France, every port goes through a central porting authority (the EGP), which forwards the request to the donor provider and schedules the transfer. Gigs handles this exchange for you.
* **Scheduled Porting:** Portings can be scheduled to happen on a specific date, which is useful for users who want to start their carrier change process early and plan ahead, minimizing downtime of their old phone number. Ports are processed Monday to Saturday, excluding French public holidays. If the scheduled date falls on a Sunday or a public holiday, the porting will be processed on the next open day.
* **Freeze:** At 3 AM Paris time on the day before the porting date, the port is frozen by the porting authority and can no longer be canceled.

In France, ports are highly regulated and the recipient provider is the user's single point of contact: porting the number automatically terminates the contract with the donor provider, so the user must not cancel it themselves. Porting is allowed while the user is still under contract, although early termination fees may apply with the donor provider.
The porting process is initiated by the end user, who must provide the RIO of the line they want to port.

**Contents:**
- [Porting lifecycle][porting-lifecycle], including End User Flow
- [Scheduling a Porting][scheduling-a-porting]
- [Information Required for a Port][information-required-for-a-port]
- [Porting Declines][porting-declines]

[porting-lifecycle]: #porting-lifecycle
[scheduling-a-porting]: #scheduling-a-porting
[information-required-for-a-port]: #information-required-for-a-port
[porting-declines]: #porting-declines

## Porting Lifecycle

The following sections describe the lifecycle of a porting in France, including the end user flow for porting in their existing phone number.

Portings can be requested on subscription creation or for an existing active subscription.

<Note type="warning">
    A subscription can have **only one successfully completed porting**.
</Note>

### End User Flow: Porting In Their Existing Phone Number (RIO)

Below is an overview of the porting process:

1. User wants to bring their phone number to their new plan and calls 3179 from that line to obtain their RIO.
2. You [create a porting][create-a-porting] with the phone number and the RIO as the account pin. Optionally, specify a `scheduledOn` date to schedule the porting (see [Scheduling a Porting][scheduling-a-porting]).
3. Request the porting:
    - with a new subscription: [create a subscription][create-a-subscription] through the API and reference the porting, or
    - with an existing active subscription: [request a port for an existing subscription][port-in-a-subscription] and reference the porting.
4. Gigs submits the port to the porting authority, which forwards it to the donor provider.
5. The donor provider validates the RIO and the phone number. Once eligibility is confirmed, the porting moves to `requested` and its `scheduledOn` reflects the porting date confirmed by the provider.
6. At 3 AM Paris time on the day before the porting date, the port is frozen and can no longer be canceled.
7. On the porting date, the number is transferred during the day (between 11 AM and 3 PM Paris time). The previous contract with the donor provider is automatically terminated and the user loses connectivity on their number for a few hours.
8. The `status` of the porting moves to `completed` (see section [Lifecycle][lifecycle]) and Gigs activates the new subscription with the ported phone number.

<Note type="info">
  Only the `portIn` behavior is supported in France. Terminating the previous contract without keeping the number (`cancelOnly`) is not available and is rejected with the `portingCancellationBehaviorNotSupported` error code.
</Note>

[create-a-porting]: /core/portings#create-a-porting
[update-a-porting]: /core/portings#update-a-porting
[port-in-a-subscription]: /core/subscriptions#port-a-phone-number-into-a-subscription
[lifecycle]: #lifecycle-of-the-porting-object
[create-a-subscription]: /core/subscriptions#create-a-subscription

### Lifecycle of the Porting Object
The porting process is modeled on the Gigs APIs through the [`porting`][porting] object. For a detailed description of the [`porting`][porting] object and its lifecycle, refer to the [Porting Lifecycle][porting-in-lifecycle] section in [How Porting in Works][porting-in].

[porting-in-lifecycle]: /docs/porting/how-porting-in-works#porting-lifecycle
[porting]: /core/portings
[porting-in]: /docs/porting/how-porting-in-works

<Note type="info">
  A porting in `requested` status can be [canceled][cancel-a-porting] until 3 AM Paris time on the day before the porting date. Later cancellation attempts are rejected with the `portingNotCancelable` error code and the port completes as scheduled. Canceling a porting results in the activation of the subscription with a new number.
</Note>

**On the duration of the porting process:**

The porting process in France takes at least three open days (Monday to Saturday, excluding public holidays) from the request. Without a scheduled date, the port takes place on the earliest available date. The donor provider usually confirms or declines eligibility within one open day, and at the latest before the freeze. The subscription stays `pending`, without a temporary phone number, until the porting completes.

## Scheduling a Porting

Use the `scheduledOn` attribute of the porting to choose the porting date. The date must be at least three open days and at most 59 calendar days after the request. Dates outside this window are rejected with the `portingScheduledOnInvalid` error code when the porting is created or updated.

Ports are processed Monday to Saturday, excluding French public holidays. A scheduled date that falls on a Sunday or a public holiday is not rejected: the porting is moved to the next open day. The three-open-day minimum is measured on the moved date.

When `scheduledOn` is omitted, or the scheduled date has already passed by the time the porting is requested from the provider, the port takes place on the earliest available date: three open days after the request, moved to the next open day if needed.

Once the porting is `requested`, its `scheduledOn` reflects the porting date confirmed by the provider, which is the date the number will actually be transferred.

## Information Required for a Port

Below is the information that is required to submit a port. Note that it is crucial that the RIO and phone number are correct and belong together: the RIO is validated against the phone number when the porting is created or updated, and a RIO that does not match is rejected with the `portingAccountPinInvalid` error code.

* Phone number: French mobile number that the user wants to bring to their new subscription, in E.164 format (e.g. +33612345678).
* Account pin: The RIO provided by the user.
* Recipient provider: `p35`

The donor provider is identified from the RIO, so `donorProvider` is optional. The exact attributes required for a porting are listed in the `required` attribute of the `porting` object.

<Note type="info">
  To exercise the French flow in a sandbox project, use the `t35` test provider with the [French test phone numbers](/core/testing/test-phone-numbers) and [test SIMs](/core/testing/test-sims). The test provider checks only that the RIO has 12 characters; the outcome of the porting is driven by the test phone number.
</Note>

<Note type="info">
  For users porting their number away from Gigs, the RIO is issued as port out credentials. See [How Porting Out Works][porting-out] and [retrieve port out credentials][retrieve-port-out-credentials]. Ended subscriptions remain portable for 40 days.
</Note>

## Porting Declines

If the donor provider or the porting authority refuses the port, the porting moves to `declined` with one of the [decline codes][porting-decline-codes]. In France, the following codes are used:

| Code                                  | Description                                                                                                                                  |
| ------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
| `portingAccountPinRequiredOrInvalid`  | The RIO is unknown to the donor provider or does not match the phone number. The user should obtain a fresh RIO by calling 3179 from the line. |
| `portingPhoneNumberNotFound`          | The phone number is unknown to the donor provider or is not a valid French mobile number.                                                   |
| `portingPhoneNumberNotActive`         | The phone number is no longer active with the donor provider.                                                                               |
| `portingPhoneNumberNotEligible`       | The donor provider withdrew eligibility, for example because the line was terminated after the port was accepted.                           |
| `portingPendingOtherProvider`         | The donor provider already holds a porting request for this number. The user should wait for it to complete or cancel it before retrying.  |
| `portingDeclined`                     | Any other reason.                                                                                                                            |

[Update the porting][update-a-porting] with corrected information to retry. The retry is submitted as a new request: a `scheduledOn` date that is still in the future is kept, otherwise the earliest available date applies.

[cancel-a-porting]: /core/portings#cancel-a-porting
[porting-decline-codes]: /docs/porting/how-porting-in-works#porting-decline-codes
[porting-out]: /docs/porting/how-porting-out-works
[retrieve-port-out-credentials]: /core/port-outs#retrieve-port-out-credentials
