# client.ports

> The ports methods of the morevoice Python SDK: Requests to move phone numbers you hold at another provider to this platform.

Requests to move phone numbers you hold at another provider to this platform. These methods are on `client.ports`, where `client` is a `MoreVoice` client (see [the Python SDK](https://docs.morevoice.ai/sdk/python/#connect)). On `AsyncMoreVoice` the same methods are awaited. Each one returns the response object and raises an exception when the API answers with an error.

## `cancel()`

**Cancel a port request.** Withdraws a port that has not completed (`cancellable`; a rejected port can be closed this way too). A completed or already cancelled port answers 409. Cancel well before the `port_date`: once the carrier moved the numbers it can't be undone here.

```python
# client.ports
def cancel(self, id: str, *, more_voice_version: str | Unset = UNSET, idempotency_key: str | Unset = UNSET) -> _m.PortingOrder
```

`client.ports.cancel()` · `await async_client.ports.cancel()` · `POST /ports/{id}/cancel` · [API reference](https://docs.morevoice.ai/api/operations/ports_cancel/)

### Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `str` | yes | A porting order ID (`port_…`). |

### Returns

`PortingOrder`:

| Field | Type | Description |
| --- | --- | --- |
| `object` | `"porting_order"` | Always `porting_order`. |
| `id` | `string` | A porting order ID (prefix `port_`). |
| `livemode` | `boolean` | `true` in live mode, `false` in test mode. |
| `status` | `"draft" \| "submitted" \| "in_review" \| "submitted_to_carrier" \| "docs_required" \| "scheduled" \| "completed" \| "rejected" \| …` | `submitted` (sent, waiting for our review) → `in_review` (our staff check the request and its documents) → `submitted_to_carrier` (waiting for the carrier's date) → `scheduled` (`port_date` is set) → `completed` (the numbers are your phone numbers). Or `docs_required` (another document is needed: fix it in the app), `rejected` (`rejection_reason`) or `cancelled`. `draft`: created in the app and not sent yet. |
| `numbers` | `string[]` | The numbers to move (E.164). |
| `current_carrier` | `string \| null` | The provider the numbers are with today. |
| `requested_date` | `string \| null` | The date you asked for (YYYY-MM-DD); the real date is the carrier's (`port_date`). |
| `port_date` | `string \| null` | When the numbers move: set once the carrier scheduled it (`scheduled`). |
| `rejection_reason` | `string \| null` | Why the port was rejected (`rejected` only). |
| `documents` | `object` | — |
| `estimate_business_days` | `object \| null` | How long such a port usually takes, in business days (an estimate, not a promise). |
| `cancellable` | `boolean` | POST /v1/ports/{id}/cancel is still possible. |
| `source` | `"app" \| "api"` | Where it was filed: in the app (Phone numbers → Port your numbers) or through this API. |
| `timeline` | `object[]` | Each change of `status`, oldest first. |
| `submitted_at` | `string \| null` | — |
| `completed_at` | `string \| null` | — |
| `created` | `string` | An ISO-8601 timestamp in UTC. |
| `updated` | `string` | An ISO-8601 timestamp in UTC. |

### Example

```python
from morevoice import MoreVoice

client = MoreVoice()  # MOREVOICE_API_KEY from the environment

porting_order = client.ports.cancel("port_7Hk2Lm9Qp")
print(porting_order)
```

## `create()`

**Request a number port.** Files a request to move phone numbers you hold at another Israeli provider to this platform, and sends it. Upload the signed letter of authorization (LOA) and the latest invoice first (POST /v1/files, purpose `port_document`) and pass their ids. Checked: Israeli fixed-line, 07x or mobile numbers (at most 50), none already on the platform or in another open port, the holder's ID or company number, both documents, and at most 20 ports in progress per organization. Our staff review it, send it to the carrier and confirm the date; follow it with GET /v1/ports/{id} or the `number.port_updated` event. Once completed the numbers are your phone numbers (`number.port_completed` per number) and their monthly fee starts. Needs a live key.

```python
# client.ports
def create(self, body: _m.PortCreateParamsInput | Mapping[str, Any], *, more_voice_version: str | Unset = UNSET, idempotency_key: str | Unset = UNSET) -> _m.PortingOrder
```

`client.ports.create()` · `await async_client.ports.create()` · `POST /ports` · [API reference](https://docs.morevoice.ai/api/operations/ports_create/)

### Request body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `numbers` | `string[]` | yes | The Israeli numbers to move, E.164 (+9723…) or national (03…): fixed-line, 07x VoIP or mobile, at most 50. Toll-free, shared-cost and premium (1-800, 1-700 …) and foreign numbers can't be ported. |
| `current_carrier` | `string` | yes | The provider the numbers are with today: one of bezeq, partner, cellcom, pelephone, hot, golan, 019, rami_levy, bezeq_international, xphone, voicenter, or its name. |
| `account_holder` | `object` | yes | Who holds the account at the current provider: the name, and the ID or company number it is registered to. |
| `loa_file_id` | `string` | yes | The signed letter of authorization (LOA): a file uploaded with POST /v1/files, purpose `port_document`. |
| `invoice_file_id` | `string` | yes | The latest invoice from the current provider (at most 30 days old): a file uploaded with POST /v1/files, purpose `port_document`. |
| `account_number` | `string` | no | The account or customer number at the current provider (helps the carrier match the request). |
| `billing_address` | `object` | no | The account's billing address at the current provider, as on the invoice. |
| `requested_date` | `string` | no | The date you would like the numbers to move (from today on). The carrier sets the real date. |

### Returns

`PortingOrder`:

| Field | Type | Description |
| --- | --- | --- |
| `object` | `"porting_order"` | Always `porting_order`. |
| `id` | `string` | A porting order ID (prefix `port_`). |
| `livemode` | `boolean` | `true` in live mode, `false` in test mode. |
| `status` | `"draft" \| "submitted" \| "in_review" \| "submitted_to_carrier" \| "docs_required" \| "scheduled" \| "completed" \| "rejected" \| …` | `submitted` (sent, waiting for our review) → `in_review` (our staff check the request and its documents) → `submitted_to_carrier` (waiting for the carrier's date) → `scheduled` (`port_date` is set) → `completed` (the numbers are your phone numbers). Or `docs_required` (another document is needed: fix it in the app), `rejected` (`rejection_reason`) or `cancelled`. `draft`: created in the app and not sent yet. |
| `numbers` | `string[]` | The numbers to move (E.164). |
| `current_carrier` | `string \| null` | The provider the numbers are with today. |
| `requested_date` | `string \| null` | The date you asked for (YYYY-MM-DD); the real date is the carrier's (`port_date`). |
| `port_date` | `string \| null` | When the numbers move: set once the carrier scheduled it (`scheduled`). |
| `rejection_reason` | `string \| null` | Why the port was rejected (`rejected` only). |
| `documents` | `object` | — |
| `estimate_business_days` | `object \| null` | How long such a port usually takes, in business days (an estimate, not a promise). |
| `cancellable` | `boolean` | POST /v1/ports/{id}/cancel is still possible. |
| `source` | `"app" \| "api"` | Where it was filed: in the app (Phone numbers → Port your numbers) or through this API. |
| `timeline` | `object[]` | Each change of `status`, oldest first. |
| `submitted_at` | `string \| null` | — |
| `completed_at` | `string \| null` | — |
| `created` | `string` | An ISO-8601 timestamp in UTC. |
| `updated` | `string` | An ISO-8601 timestamp in UTC. |

### Example

```python
from morevoice import MoreVoice

client = MoreVoice()  # MOREVOICE_API_KEY from the environment

porting_order = client.ports.create({
    "account_holder": {
        "company_id": "514000013",
        "name": "Acme Ltd",
    },
    "account_number": "ACC-778899",
    "billing_address": {
        "city": "Tel Aviv",
        "line1": "12 Herzl St",
        "postal_code": "6100001",
    },
    "current_carrier": "bezeq",
    "invoice_file_id": "file_8YhD1fK6pQr3VbNx2SmTa",
    "loa_file_id": "file_3NcP7sQ2wLm9TzXb4RkVu",
    "numbers": [
        "+97235550100",
        "0775556789",
    ],
    "requested_date": "2026-12-01",
})
print(porting_order)
```

## `list()`

**List port requests.** Your requests to move phone numbers to this platform, newest first, whether filed in the app or through this API. Filter by `status`. Needs a live key.

```python
# client.ports
def list(self, *, limit: int | Unset = 20, starting_after: str | Unset = UNSET, ending_before: str | Unset = UNSET, status: _m.PortsListStatus | Unset = UNSET, more_voice_version: str | Unset = UNSET) -> AsyncPage[_m.PortingOrder]
```

`client.ports.list()` · `await async_client.ports.list()` · `GET /ports` · [API reference](https://docs.morevoice.ai/api/operations/ports_list/)

### Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `limit` | `integer` | no | How many objects to return, 1–100 (default 20). |
| `starting_after` | `string` | no | A cursor (`next_cursor`) or object ID: return the objects after it (older). |
| `ending_before` | `string` | no | A cursor or object ID: return the objects before it (newer). |
| `status` | `"draft" \| "submitted" \| "in_review" \| "submitted_to_carrier" \| "docs_required" \| "scheduled" \| "completed" \| "rejected" \| …` | no | Only ports in this status. |

### Returns

A page of results (`PortingOrderList`): `data`, `has_more` and `next_cursor`.

### Example

```python
from morevoice import MoreVoice

client = MoreVoice()  # MOREVOICE_API_KEY from the environment

for port in client.ports.list():
    print(port)
```

## `retrieve()`

**Retrieve a port request.** One port request, with its status, the date once scheduled and its timeline.

```python
# client.ports
def retrieve(self, id: str, *, more_voice_version: str | Unset = UNSET) -> _m.PortingOrder
```

`client.ports.retrieve()` · `await async_client.ports.retrieve()` · `GET /ports/{id}` · [API reference](https://docs.morevoice.ai/api/operations/ports_retrieve/)

### Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `str` | yes | A porting order ID (`port_…`). |

### Returns

`PortingOrder`:

| Field | Type | Description |
| --- | --- | --- |
| `object` | `"porting_order"` | Always `porting_order`. |
| `id` | `string` | A porting order ID (prefix `port_`). |
| `livemode` | `boolean` | `true` in live mode, `false` in test mode. |
| `status` | `"draft" \| "submitted" \| "in_review" \| "submitted_to_carrier" \| "docs_required" \| "scheduled" \| "completed" \| "rejected" \| …` | `submitted` (sent, waiting for our review) → `in_review` (our staff check the request and its documents) → `submitted_to_carrier` (waiting for the carrier's date) → `scheduled` (`port_date` is set) → `completed` (the numbers are your phone numbers). Or `docs_required` (another document is needed: fix it in the app), `rejected` (`rejection_reason`) or `cancelled`. `draft`: created in the app and not sent yet. |
| `numbers` | `string[]` | The numbers to move (E.164). |
| `current_carrier` | `string \| null` | The provider the numbers are with today. |
| `requested_date` | `string \| null` | The date you asked for (YYYY-MM-DD); the real date is the carrier's (`port_date`). |
| `port_date` | `string \| null` | When the numbers move: set once the carrier scheduled it (`scheduled`). |
| `rejection_reason` | `string \| null` | Why the port was rejected (`rejected` only). |
| `documents` | `object` | — |
| `estimate_business_days` | `object \| null` | How long such a port usually takes, in business days (an estimate, not a promise). |
| `cancellable` | `boolean` | POST /v1/ports/{id}/cancel is still possible. |
| `source` | `"app" \| "api"` | Where it was filed: in the app (Phone numbers → Port your numbers) or through this API. |
| `timeline` | `object[]` | Each change of `status`, oldest first. |
| `submitted_at` | `string \| null` | — |
| `completed_at` | `string \| null` | — |
| `created` | `string` | An ISO-8601 timestamp in UTC. |
| `updated` | `string` | An ISO-8601 timestamp in UTC. |

### Example

```python
from morevoice import MoreVoice

client = MoreVoice()  # MOREVOICE_API_KEY from the environment

porting_order = client.ports.retrieve("port_7Hk2Lm9Qp")
print(porting_order)
```
