# Linked orders

Linked orders allow patrons to purchase additional food and beverage items via a linked 'child' order after an initial
'parent' standard order has been completed.

## Parent orders

A parent order is the initial [standard order](/digital-platform/orders/standard-orders) that contains tickets and/or items and has one or more
subsequent child orders linked to it.

## Child orders

A child order is a [standard order](/digital-platform/orders/standard-orders) that's used to purchase food and beverage items after a parent order has been completed.

Child orders can be used to:

- Order food and beverage items after purchasing tickets.
- Order food and beverage items after an initial food delivery order.


### Child order flow

```mermaid
flowchart TB
    A(Get completed standard order) --> B
    B(Create child order) --> C
    C(Get item profile) --> D
    D(Set items) --> E
    E(Set customer details) --> F
    F(Order completion and payment)
```

### Creating a child order

Child orders are created via the
[CreateChildOrder](/openapi/digital-platform/openapi/completed-orders/ocapicompletedorders_createchildorder/) endpoint, using
the unique identifier of the parent order.

```json
{
  "id": "string",
  "type": "Standard",
  "parentOrderId": "string",
  "items": []
}
```

NOTE
Some properties have been omitted from the code snippet above for brevity.

### Limitations

The following limitations apply to child orders:

- Child orders cannot be used to purchase tickets.
- Child orders must be created before the parent order has expired. See [completed order expiry](/digital-platform/completed-orders/expiry) for more info.
- A child order cannot be created from another child order (i.e. only a single level of child orders is supported under a parent).


### Item and discount availability

If any showtimes were associated with the parent order (either via ticket purchase or in-seat item delivery), the
earliest showtime will be used to determine the availability of items and discounts for all child orders.

If the parent order does not contain a showtime, item and discount availability will be based on the current purchase time.

### Customer details

As with [standard orders](/digital-platform/orders/standard-orders), use the
[SetCustomer](/openapi/digital-platform/openapi/orders/ocapiordercustomer_setcustomer/) endpoint to set customer
details for a child order. These details do **not** need to match the customer details of the parent order.

To prevent the parent order's customer details from being shared if the patron shares a link to their order with
others, the customer details of the parent order are **not** automatically inherited by the child order.

### Loyalty member

If the patron is an [authenticated member](/digital-platform/loyalty/member-authentication), the child order will be assigned to
them.

If the patron is not authenticated, the child order will be automatically assigned to the Loyalty member of the parent
order, if applicable. This ensures that the member of the parent order earns any associated [balance
units](/digital-platform/loyalty/member-balances#balance-units) (aka points) for the child order.

NOTE
Linked parent and child orders can be created by different Loyalty members.

## Load linked order details

The [GetCompletedOrder](/openapi/digital-platform/openapi/completed-orders/ocapicompletedorders_getcompletedorder/) endpoint
returns the details of the requested completed order (parent or child) plus any linked orders, allowing for a complete
view of completed orders for the given linked order group.

## Order collection

Linked orders can be collected at POS or Kiosk, marked as collected via OCAPI, or sent to the kitchen for preparation.

See [completed order collection](/digital-platform/completed-orders/collection) for more info.

## Item delivery preparation

Preparation of item deliveries with an `OnRequest` schedule can be requested for a single delivery, all deliveries in an
order, or all deliveries in a linked order group.

See [item delivery preparation](/digital-platform/completed-orders/item-delivery-preparation#on-request-schedule) for more info.

## Refunds

Orders are always refunded individually, regardless of whether they are standalone, parent, or child orders. In addition
to the restrictions that apply to all orders, parent orders cannot be refunded until all linked child orders have been
fully refunded.

See [completed order refunds](/digital-platform/completed-orders/refunds) for more info.