---
updatedAt: 2026-01-26T13:57:07.000Z
agentTools:
  projectIndex: https://docs.nextpertise.nl/llms.txt
---

# Changing the bandwidth of a fixed broadband connection

```shell Shell
import requests

# Configure the Nextpertise API
NEXTPERTISE_API = "https://api.nextpertise.nl"
NEXTPERTISE_TOKEN = "xxx"

# Get the existing connection information, including the current circuits.
connection_uuid = "16be5c0d-2f49-4ed0-8964-85908b5f2098"
connection_details_response = requests.get(
    f"{NEXTPERTISE_API}/mixed-broadband/connections/{connection_uuid}/",
    headers={"Authorization": f"Bearer {NEXTPERTISE_TOKEN}"},
)
connection_details_response.raise_for_status()  # Check if the request was successful
connection_details = connection_details_response.json()

# A connection can have multiple circuits. For this recipe, we only change the first one.
circuits = connection_details["circuits"]
first_circuit = circuits[0]
circuit_uuid = first_circuit["uuid"]

print(f"Current circuit product: {first_circuit['product']['i18n_name']} ({first_circuit['product']['uuid']})")
# Current circuit product: Regular circuit 1000mb (18a8735b-479d-4112-9bcc-fff7ceecd47a)


# Find available circuit products for this connection
available_circuit_products_response = requests.get(
    f"{NEXTPERTISE_API}/mixed-broadband/products/availability/circuits/",
    params={"connection_uuid": connection_uuid},
    headers={"Authorization": f"Bearer {NEXTPERTISE_TOKEN}"},
)
available_circuit_products_response.raise_for_status()  # Check if the request was successful
available_circuit_products = available_circuit_products_response.json()
print(available_circuit_products)
# [
#   {'uuid': 'e5cc059f-e880-405d-b6a0-1aa6a26612e2', 'i18n_name': 'Regular circuit 50mb', 'download_speed_in_bytes': 51200000, 'download_speed_i18n': '50 Mb', 'upload_speed_in_bytes': 51200000, 'upload_speed_i18n': '50 Mb', (...)},
#   {'uuid': '6cd9ed16-cd19-4872-967c-b6e5b84e829b', 'i18n_name': 'Regular circuit 100mb', 'download_speed_in_bytes': 100000000, 'download_speed_i18n': '100 Mb', 'upload_speed_in_bytes': 100000000, 'upload_speed_i18n': '100 Mb', (...)},
#   {'uuid': '78c5d6e4-5cec-461c-aedc-0c43880eeb4d', 'i18n_name': 'Regular circuit 200mb', 'download_speed_in_bytes': 200000000, 'download_speed_i18n': '200 Mb', 'upload_speed_in_bytes': 200000000, 'upload_speed_i18n': '200 Mb', (...)},
#   {'uuid': '12edbd89-113c-4746-a531-02892b8e8a2d', 'i18n_name': 'Regular circuit 500mb', 'download_speed_in_bytes': 524000000, 'download_speed_i18n': '500 Mb', 'upload_speed_in_bytes': 524000000, 'upload_speed_i18n': '500 Mb', (...)},
#   {'uuid': '18a8735b-479d-4112-9bcc-fff7ceecd47a', 'i18n_name': 'Regular circuit 1000mb', 'download_speed_in_bytes': 1000000000, 'download_speed_i18n': '1 Gb', 'upload_speed_in_bytes': 1000000000, 'upload_speed_i18n': '1 Gb', (...)},
#   {'uuid': '1aa21f69-1319-403d-a3f7-1a40f4009369', 'i18n_name': 'Premium circuit 256kb', 'download_speed_in_bytes': 256000, 'download_speed_i18n': '256 Kb', 'upload_speed_in_bytes': 256000, 'upload_speed_i18n': '256 Kb', (...)},
#   {'uuid': 'da46fe04-0b62-495c-9c5a-d6740f33d3f3', 'i18n_name': 'Premium circuit 1mb', 'download_speed_in_bytes': 1024000, 'download_speed_i18n': '1.0 Mb', 'upload_speed_in_bytes': 1024000, 'upload_speed_i18n': '1.0 Mb', (...)},
#   (...)
# ]

# Select a new circuit product to switch to (e.g., the regular 200mb circuit: number 3 from the list)
new_circuit_product = available_circuit_products[2]
print(f"Switching to: {new_circuit_product['i18n_name']} ({new_circuit_product['uuid']})")


# Create the circuit product order
circuit_product_path = f"fixed-broadband/connections/{connection_uuid}/circuits/{circuit_uuid}/product"
circuit_patch = {"uuid": new_circuit_product["uuid"]}

# Get the order receipt to see if our order will change the pricing of the connection
# We can do this by appending 'receipt/' to the API endpoint, and sending a POST request with the order details
order_receipt_response = requests.post(
    f"{NEXTPERTISE_API}/{circuit_product_path}/receipt/",
    headers={"Authorization": f"Bearer {NEXTPERTISE_TOKEN}"},
    json={"order_method": "PATCH", "order": circuit_patch},
)
order_receipt_response.raise_for_status()  # Check if the request was successful

print(order_receipt_response.json())
# {
#  'prices_per_category': [{
#    'i18n_name': 'Per month', 'type': 'product',
#    'prices': [{
#      'i18n_name': 'Kpn netwerk nl - best effort - symmetrisch xdsl / ftth/o - 100 / 100mbit/s',
#      'recurring': True, 'recurring_interval': 1, 'recurring_interval_unit': 'months',
#      'type': 'product', 'count': 1, 'categories': [],
#      'price': '25.00', 'i18n_price': '€25.00'}
#    ],
#    'total_price': {
#      'i18n_name': 'Total', 'type': 'product',
#      'recurring': True, 'recurring_interval': 1, 'recurring_interval_unit': 'months',
#      'price': '25.00', 'i18n_price': '€25.00'
#    }
#  }],
#  'products_included': [{'i18n_name': 'Regular circuit 100mb', 'uuid': '6cd9ed16-cd19-4872-967c-b6e5b84e829b'}]
# }


# Check how long we expect this order to take, using the same logic as the receipt, but by adding
# 'planning' to the path instead.
order_planning_response = requests.post(
    f"{NEXTPERTISE_API}/{circuit_product_path}/planning/",
    headers={"Authorization": f"Bearer {NEXTPERTISE_TOKEN}"},
    json={"order_method": "PATCH", "order": circuit_patch},
)
order_planning_response.raise_for_status()  # Check if the request was successful
print(order_planning_response.json())
# {
#   'estimated_duration': {'months': 0, 'weeks': 0, 'days': 0, 'hours': 0, 'minutes': 0, 'is_realtime': True},
#   'first_plannable_date': '2026-01-27',
#   'i18n_estimated_duration': 'Realtime' <- Realtime means the transaction should be finished within a (few) minutes
#   }

# Now, let's send the actual order!
order_response = requests.patch(
    f"{NEXTPERTISE_API}/{circuit_product_path}/",
    headers={"Authorization": f"Bearer {NEXTPERTISE_TOKEN}"},
    json=circuit_patch,
)
order_response.raise_for_status()
order_details = order_response.json()
print(order_details)  # The response contains information about the transaction that the order just created.
# {
#   'uuid': '5c54687a-ef13-4ef5-97b1-897a80368b62',
#   'organization': (...),
#   'state': 'open', type': 'change_order',
#   'created_at': '2026-01-26T13:21:35Z', 'finished_at': None, 'last_updated_at': '2026-01-26T13:21:35Z',
#   'is_visible': True, 'i18n_administrative_state': 'Change in progress',
#   'i18n_state': 'In Progress', 'i18n_type': 'Change',
#   'connection_identifiers': {'nid': '2241XE000210200', 'uuid': '16be5c0d-2f49-4ed0-8964-85908b5f2097', 'msisdn': None, 'iccid': None},
#   'end_user': {'uuid': 'c345b5a2-1a18-435f-a17c-2f124438cea1', (...)},
#   'data_pool': None,
#   'delivery_details': None
# }


# Let's check if the transaction is finished.
transaction_uuid = order_details["uuid"]
transaction_response = requests.get(
    f"{NEXTPERTISE_API}/mixed-broadband/transactions/{transaction_uuid}/",
    headers={"Authorization": f"Bearer {NEXTPERTISE_TOKEN}"},
)
transaction_response.raise_for_status()  # Check if the request was successful
transaction_details = transaction_response.json()

print(f"The transaction is currently {transaction_details['state']}.")
# The transaction is currently open.

# The transaction is finalized when the state is either 'finished' or 'cancelled'.
if transaction_details["state"] == "finished":
    print("The transaction finished successfully!")
elif transaction_details["state"] == "cancelled":
    print("The transaction was cancelled.")

```

# Configure the API

<!-- shell@3-6 -->

Set the Nextpertise API location and your API token. More information about obtaining a new API token can be found on the [Authentication](https://docs.nextpertise.nl/reference/authentication) page.

# Get current connection details

<!-- shell@7-15 -->

Get information about the connection we want to change using the [Get Connection Details](https://docs.nextpertise.nl/reference/get_connection_details) endpoint.

# Find the circuit to change

<!-- shell@16-22 -->

Most connections will only have a single circuit. Changing the bandwidth without changing the underlying technology is as simple as changing the product of that circuit. Let's see what the current bandwidth of our connection is.

# Find available circuit products

<!-- shell@25-43 -->

Using the [Get Available Circuit Products](https://docs.nextpertise.nl/reference/get_available_circuit_products) with the `connection_uuid` param set to our connection, we check which products are available on this connection.

# Select the new circuit product

<!-- shell@45-47 -->

There are a lot of different products to choose from! We will choose the best effort 200mbps product. From the previous response we know that this is the third item from the list. Let's store its UUID.

# Create the order payload

<!-- shell@50-52 -->

Changing a connection is simple. The patch body corresponds to the locations and paths we know from the [Get Connection Details](https://docs.nextpertise.nl/reference/get-connection-details) response. 

We will be using the [Change Connection Circuit Product](https://docs.nextpertise.nl/reference/change_connection_circuit_product) endpoint. Based on the URL path, we are already at `circuits[$UUID].product`, so we only need to patch the `uuid` field of the product.

# Check the order receipt

<!-- shell@54-80 -->

Before we order, let's see if there are any costs associated with this order! We can do this by simply appending /receipt/ to the order API endpoint and telling it what we plan to order (method & body). This is the [Change Connection Circuit Product Receipt](https://docs.nextpertise.nl/reference/change_connection_circuit_product_receipt) endpoint.

# Check the order duration and planning

<!-- shell@83-96 -->

Similar to checking which products will be added by this order, we can also check how long we expect this order to take. We do this using the [Change Connection Circuit Product Planning](https://docs.nextpertise.nl/reference/change_connection_circuit_product_planning).

# Order the bandwidth change!

<!-- shell@98-118 -->

Now we can finally order the new circuit product to change the bandwidth on this connection! By ordering a change on a connection, we start a transaction that can take some time to complete. When our order using the [Change Connection Circuit Product](https://docs.nextpertise.nl/reference/change_connection_circuit_product) is successful, it returns information about the transaction that we just started.

# Wait for the order to complete

<!-- shell@121-137 -->

Now that the order is placed, we know from the /planning/ API that this is expected to be done in realtime. In practice, this means that it will take less than 5 minutes to complete. In the this time, the transaction we just created will stay open and other change orders on this connection are not allowed. It is always possible that a change turns out to be more difficult than expected and that the change transaction stays open longer than expected.

Information about the state of the transaction can be received using the Get Transaction Details API. When the transaction is finished, the connection details are updated to reflect the new circuit product.