---
title: Track Order Only Services
slug: track-order-only-services
docTags: 
createdAt: 2026-01-20T21:40:20.548Z
---

Some services need to be **ordered and recorded**, but do not require ongoing lifecycle management after fulfilment. In these cases, Activate supports **order-only services that immediately end themselves**, allowing the order to be tracked without leaving an active service instance behind.

This approach is commonly used for **physical or consumable items** where return, expiry, or revocation is not relevant, but audit and reporting of the order itself is still valuable.

# Order-only services with immediate end behaviour

Order-only services are designed to trigger fulfilment without behaving like long-lived services. When configured correctly, the service instance is created for tracking purposes and then immediately ended as part of the order process.

This allows you to:

- Record that the service was ordered&#x20;
- Run fulfilment processes as normal&#x20;
- Avoid cluttering user records with inactive services&#x20;
- Retain accurate reporting and audit history&#x20;

# When to use this approach

Use this pattern when:

- The service represents a **one-off item**&#x20;
- There is **no concept of return, expiry, or revocation**&#x20;
- The order itself must be auditable or reportable&#x20;
- The service should not appear as active for the user&#x20;

Common examples include:

- Mouse pads&#x20;
- Peripherals&#x20;
- Printed materials&#x20;
- Welcome or starter items&#x20;

# How the behaviour works

When an order-only service is requested:

1. The service order runs as normal&#x20;
2. The service instance is saved so the order can be tracked&#x20;
3. The service instance is immediately ended as part of the order process&#x20;

From a configuration perspective, this happens entirely within the **order process**, without requiring the service to behave like a managed lifecycle service.

This behaviour applies only to order-only services. Standard services continue to follow their normal lifecycle rules.

# Implementation overview

This pattern consists of:

1. An **order-only service**&#x20;
2. An **order process** attached to that service&#x20;
3. A **script** in the order process that immediately ends the service instance after saving it&#x20;

# Service configuration

The service must be configured as **order-only**.

This ensures:

- The service does not remain active after fulfilment&#x20;
- The lifecycle is controlled by the order process&#x20;
- The service instance exists only for tracking and reporting&#x20;

# Order process configuration

Attach an order process to the service. This process is responsible for:

- Handling fulfilment&#x20;
- Saving the service instance&#x20;
- Ending the service instance immediately once recorded&#x20;

The script below must be executed as part of this order process.

# Order process script

The following script processes the services included in the order, saves any new order-only service instances, and immediately ends them.  This script can be found at `//Tasks/Services/Order/OrderOnlyScript` out of the box

### 8.2 version

This version is for 8.2 and above

```csharp
using System;
using System.Xml;
using Innovation.Activate;

class Script : ScriptBase
{
	public void main()
	{
		ServiceInstanceCollection services = new ServiceInstanceCollection(null);

		foreach (XmlElement n in Job.Arguments.SelectNodes("services/*"))
		{
			ServiceInstance srv = ServiceInstance.GetFromXml(n);
			if (srv == null) continue;
			
			if(srv.Id>0) continue; // Already created

			if (srv.Status == ProvisioningObject.ProvisioningObjectStatus.Published && srv.Flags.HasFlag(ServiceInstance.ServiceFlags.OrderOnly))
			{
				srv.Status = ProvisioningObject.ProvisioningObjectStatus.Deleted;
				srv.SetInfo();
				XmlValue.Set(n, "id", srv.Id.ToString());
			}
		}

	}
}

```

### 8.1 Version

This version applies to 8.1 and below.

```csharp
using System;
using System.Xml;
using Innovation.Activate;

class Script : ScriptBase
{
	public void main()
	{
		ServiceInstanceCollection services = new ServiceInstanceCollection(null);

		foreach (XmlElement n in Job.Arguments.SelectNodes("services/*"))
		{
			ServiceInstance srv = ServiceInstance.GetFromXml(n);
			if (srv == null) continue;
			
			if(srv.Id>0) continue; // Already created

			if (srv.Status == ProvisioningObject.ProvisioningObjectStatus.Published && srv.Flags.HasFlag(ServiceInstance.ServiceFlags.OrderOnly))
			{
				srv.SetInfo();
				srv.Delete(Job, false);
				XmlValue.Set(n, "id", srv.Id.ToString());
			}
		}

	}
}

```

This script ensures that:

- The order is fully recorded&#x20;
- The service instance does not remain active&#x20;
- The order can be audited and reported on&#x20;

# Reporting behaviour

Although the service instance is immediately ended:

- The order is still visible in service history&#x20;
- Reports can show when the service was ordered and by whom&#x20;
- The service does not appear as active for the user&#x20;

This makes the approach suitable for:

- Consumable or physical item reporting&#x20;
- Audit trails&#x20;
- Cost or chargeback reporting&#x20;

# Version notes

- In Activate 8.1, the recommended approach is to save the service instance and immediately end it in the order process&#x20;
- In Activate 8.2 and later, order-only services also support being ended at creation time&#x20;

For maximum compatibility, using the order-process script to end the service instance works consistently across versions.

# Summary

Order-only services with immediate end behaviour allow you to:

- Trigger fulfilment workflows&#x20;
- Maintain clean user service records&#x20;
- Retain accurate order history&#x20;

They are ideal for scenarios where **tracking the order matters, but tracking the service lifecycle does not**.
