Order templates in SDK

Use templates to create tasking and catalog orders.


Overview

Order new or archive geospatial data.

View repository

Constants

ConstantDescriptionValue
UnitTypeThe type of unit.Literal["SQ_KM", "SCENE"]

Class: OrderError

A data class that represents errors encountered during order cost estimation or creation.

Attributes

AttributeDescription
index

int

The failed geometry index number.

message

str

The error message associated with the failed geometry.

details

str

Error message details.

Class: OrderReference

A data class that represents references to orders in the system.

Attributes

AttributeDescription
index

int

A sequence identifier for the order reference.

id

str

The order ID.


Properties

order

Retrieves the full details of the order associated with the reference.

Python
from up42.order_template import OrderReference
# Select an order
order_id = "68567134-27ad-7bd7-4b65-d61adb11fc78"
# Create an OrderReference instance for the given order and access order details
order_ref = OrderReference(index=0, id=order_id)
full_order = order_ref.order
# Define output
print(f"Display name: {getattr(full_order, 'display_name', 'N/A')}")
print(f"Status: {full_order.status}")
# Uncomment the following lines to fetch tasking-only parameters
# print(f"Substatus: {full_order.details.sub_status}")
# print(f"Acquisition start date: {full_order.details.acquisition_start}")
# print(f"Acquisition end date: {full_order.details.acquisition_end}")
# print(f"Order description: {full_order.details.extra_description}")
# print(f"Geometry: {full_order.details.geometry}")
tags = getattr(full_order, "tags", [])
print("Tags:", ", ".join(tags) if tags else "No tags")

Class: OrderCost

A data class that represents the cost details of an order.

Attributes

AttributeDescription
index

int

The geometry index number. Indexing starts from zero.

credits

float

The estimated cost of the geometry, in credits.

size

float

The size of the geometry.

unit

UnitType

The unit of measurement used to calculate the size.

Class: Estimate

A data class that represents the estimated cost of a tasking or catalog order batch.

Attributes

AttributeDescription
items

list[Union[OrderCost, OrderError]]

A list of geometries in the estimation. It might include successful cost details (OrderCost) or errors encountered during the estimation (OrderError).

credits

float

The estimate of the order batch cost, in credits.

size

float

The size of the order batch in square kilometers or the number of scenes needed to cover the requested geometry.

unit

UnitType

The unit of measurement used to calculate the size.

Python
import geojson
# Define order geometry
13 collapsed lines
geometry = {
"type": "Polygon",
"coordinates": [[
[13.369713, 52.452327],
[13.369713, 52.470760],
[13.339159, 52.470760],
[13.339159, 52.452327],
[13.369713, 52.452327]
]]
}
# Wrap the geometry into a GeoJSON FeatureCollection
features = geojson.FeatureCollection(features=[geojson.Feature(geometry=geometry)])
# Instantiate a BatchOrderTemplate with the given parameters
order_template = up42.BatchOrderTemplate(
data_product_id="c3de9ed8-f6e5-4bb5-a157-f6430ba756da",
display_name="Sentinel-2 over Berlin",
features=features,
params={
"id": "S2B_T32UQD_20250520T102551_L2A"
},
tags=["sentinel-berlin"]
)
# Estimate the cost
estimate = order_template.estimate
# Define output
7 collapsed lines
print(f"Total credits: {estimate.credits}")
print(f"Total size: {estimate.size} {estimate.unit}")
print("Geometry items:")
for item in estimate.items:
print(f" - Index: {item.index}")
print(f" Credits: {item.credits}")
print(f" Size: {item.size} {item.unit}")

Class: BatchOrderTemplate

A data class that defines a template for creating and estimating batch orders.

Attributes

AttributeDescription
data_product_id

str

The data product ID.

display_name

str

A human-readable name that describes the order.

tags

list[str]

A list of tags that categorize the order. A tag can consist of letters, numbers, spaces, and special characters (., -, _, /, :). If the list is empty, tags will be removed.

features

geojson.FeatureCollection

A GeoJSON FeatureCollection representing the order’s geometry.

params

dict

Order parameters. To retrieve the required and optional parameters needed to create an order for a specific data product, use DataProduct.schema.

Python
import geojson
# Define order geometry
13 collapsed lines
geometry = {
"type": "Polygon",
"coordinates": [[
[13.369713, 52.452327],
[13.369713, 52.470760],
[13.339159, 52.470760],
[13.339159, 52.452327],
[13.369713, 52.452327]
]]
}
# Wrap the geometry into a GeoJSON FeatureCollection
features = geojson.FeatureCollection(features=[geojson.Feature(geometry=geometry)])
# Instantiate a BatchOrderTemplate with the given parameters
order_template = up42.BatchOrderTemplate(
data_product_id="c3de9ed8-f6e5-4bb5-a157-f6430ba756da",
display_name="Sentinel-2 over Berlin",
features=features,
params={
"id": "S2B_T32UQD_20250520T102551_L2A"
},
tags=["sentinel-berlin"]
)

Methods

place

Submits a batch order. Returns list[Union[OrderReference, OrderError]].

Python
import geojson
# Define order geometry
13 collapsed lines
geometry = {
"type": "Polygon",
"coordinates": [[
[13.369713, 52.452327],
[13.369713, 52.470760],
[13.339159, 52.470760],
[13.339159, 52.452327],
[13.369713, 52.452327]
]]
}
# Wrap the geometry into a GeoJSON FeatureCollection
features = geojson.FeatureCollection(features=[geojson.Feature(geometry=geometry)])
# Instantiate a BatchOrderTemplate with the given parameters
order_template = up42.BatchOrderTemplate(
data_product_id="c3de9ed8-f6e5-4bb5-a157-f6430ba756da",
display_name="Sentinel-2 over Berlin",
features=features,
params={
"id": "S2B_T32UQD_20250520T102551_L2A"
},
tags=["sentinel-berlin"]
)
# Submit the order
order_template.place

Learn more


Last updated: