---
updatedAt: 2026-09-18T18:59:21.000Z
agentTools:
  projectIndex: https://docs.photon.health/llms.txt
---

# Order Events

## photon:order:created

An order has been created

#### Schema

| Param      | Type              | Description                                                                                                                                                    |
| :--------- | :---------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| id         | string            | Internal Photon ID for the order                                                                                                                               |
| externalId | string (optional) | External ID passed in during order creation                                                                                                                    |
| pharmacyId | string            | Photon ID of the pharmacy that the order was sent to                                                                                                           |
| patient    | Object            | Object containing the Photon ID and the external id of the patient                                                                                             |
| fills      | Array\<Object>    | Array of fill objects that were created for this order. Each fill object includes the ID of the fill and the ID and external ID of the associated prescription |

#### Sample Event

```json
{
    "id": "01G8AHAFRTJ92S62AM44YTBG8W",
    "type": "photon:order:created",
    "specversion": "1.0",
    "datacontenttype": "application/json",
    "time": "2022-01-01T01:00:00.000Z",
    "subject": "ord_01G8AHAFDJ7FV2Y77FVWA19009",
    "source": "org:org_KzSVZBQixLRkqj5d",
    "data": {
        "id": "ord_01G8AHAFDJ7FV2Y77FVWA19009",
        "externalId": "1234",
        "pharmacyId": "phr_hRBVwyp23qjQR0ap",
        "patient": {
            "id": "pat_ieUv67viS0lG18JN",
            "externalId": "1234"
        },
        "fills": [
            {
                "id": "fil_01G8AHAFNSH1PJMGWECX3BYEP2",
              	"prescription": {
                  "id": "rx_01G8AGBC91W1042CDRB19545EC",
                  "externalId": "1234"
                }
            }
        ],
        "createdAt": "2022-01-01T01:00:00.000Z"
    }
}
```

***

## photon:order:placed

The order has been sent to a pharmacy. You may receive multiple placed events if an order is rerouted to a second pharmacy.

#### Schema

| Param      | Type   | Description                                                        |
| :--------- | :----- | :----------------------------------------------------------------- |
| id         | string | Internal Photon ID for the order                                   |
| externalId | string | External ID passed in during order creation                        |
| patient    | Object | Object containing the Photon ID and the external id of the patient |
| pharmacy   | Object | Object containing the Pharmacy the order was sent to               |

#### Sample Event

```json
{
  "id": "01G7Z7TNFH0YEGVZ719TQZQBER",
  "type": "photon:order:placed",
  "specversion": "1.0",
  "datacontenttype": "application/json",
  "time": "2022-01-01T01:00:00.000Z",
  "subject": "ord_01G8AHAFDJ7FV2Y77FVWA19009",
  "source": "org:org_KzSVZBQixLRkqj5d",
  "data": {
    "id": "ord_01G8AHAFDJ7FV2Y77FVWA19009",
    "externalId": "1234",
    "patient": {
      "id": "pat_ieUv67viS0lG18JN",
      "externalId": "1234"
    },
    "pharmacy": {
      "id": "phr_01J6APWHGNFJCE74SB031VYABC",
      "name": "Example Pharmacy",
      "address": {
        "city": "Georgetown",
        "postalCode": "40004",
        "state": "KY",
        "street1": "4343 Test Street",
        "street2": ""
      }
    }
  }
}
```

***

## photon:order:fulfillment

The fulfillment status of the order has been updated. You will receive multiple `photon:order:fulfillment` webhooks as the order progress at the pharmacy. Details about these different events can be found below

#### Schema

|             |        |                                                                    |
| :---------- | :----- | :----------------------------------------------------------------- |
| id          | string | Internal Photon ID for the order                                   |
| externalId  | string | External ID passed in during order creation                        |
| fulfillment | Object | Object containing the Photon ID and the external id of the patient |
| patient     | Object | Object containing the Photon ID and the external id of the patient |

#### Sample Event

```json
{
    "id": "01G54ZB2Y82V0W67G8M2VW8WEQ",
    "type": "photon:order:fulfillment",
    "specversion": "1.0",
    "datacontenttype": "application/json",
    "time": "2022-01-01T01:00:00.000Z",
    "subject": "ord_01G8AHAFDJ7FV2Y77FVWA19009",
    "source": "org:org_KzSVZBQixLRkqj5d",
    "data": {
        "id": "ord_01G8AHAFDJ7FV2Y77FVWA19009",
        "externalId": "1234",
        "fulfillment": {
            "type": "MAIL_ORDER",
            "state": "SHIPPED",
            "carrier": "USPS",
            "trackingNumber": "1LS729104296564"
        },
        "patient": {
            "id": "pat_ieUv67viS0lG18JN",
            "externalId": "1234"
        }
    }
}
```

#### Fulfillment Details

The `fulfillment` object will vary depending on the type of fulfillment the particular order has.

##### Mail Order

When the fulfillment type is `MAIL_ORDER`, the states will be one of the following:

|           |                                             |
| :-------- | :------------------------------------------ |
| SENT      | The order has been sent to the pharmacy     |
| FILLING   | The pharmacy has begun filling the order    |
| SHIPPED   | The order has been shipped                  |
| DELIVERED | The order has been delivered to the patient |

The `SHIPPED` and `DELIVERED` webhooks will include carrier and tracking number when available.

##### Pick Up

When the fulfillment type is `PICK_UP`, the states will be one of the following:

|            |                                                                                                     |
| :--------- | :-------------------------------------------------------------------------------------------------- |
| SENT       | The order has been sent to the pharmacy and is awaiting confirmation of receipt and ability to fill |
| RECEIVED   | The pharmacy has confirmed they received the order and are able to fill it                          |
| READY      | The order has been filled and is waiting for pick up                                                |
| PICKED\_UP | The order has been picked up by the patient                                                         |

***

## photon:order:completed

The order has been picked up or delivered

#### Schema

| Param      | Type   | Description                                                        |
| :--------- | :----- | :----------------------------------------------------------------- |
| id         | string | Internal Photon ID for the order                                   |
| externalId | string | External ID passed in during order creation                        |
| patient    | Object | Object containing the Photon ID and the external id of the patient |

#### Sample Event

```json
{
    "id": "01G6V8S5TYR056ET83M7Y8MKRK",
    "type": "photon:order:completed",
    "specversion": "1.0",
    "datacontenttype": "application/json",
    "time": "2022-01-01T01:00:00.000Z",
    "subject": "ord_01G8AHAFDJ7FV2Y77FVWA19009",
    "source": "org:org_KzSVZBQixLRkqj5d",
    "data": {
        "id": "ord_01G8AHAFDJ7FV2Y77FVWA19009",
        "externalId": "1234",
        "patient": {
            "id": "pat_ieUv67viS0lG18JN",
            "externalId": "1234"
        }
    }
}
```

***

## photon:order:canceled

The order has been canceled

#### Schema

| Param      | Type   | Description                                                        |
| :--------- | :----- | :----------------------------------------------------------------- |
| id         | string | Internal Photon ID for the order                                   |
| externalId | string | External ID passed in during order creation                        |
| patient    | Object | Object containing the Photon ID and the external id of the patient |

#### Sample Event

```json
{
    "id": "01G7Z7TNFH0YEGVZ719TQZQBER",
    "type": "photon:order:canceled",
    "specversion": "1.0",
    "datacontenttype": "application/json",
    "time": "2022-01-01T01:00:00.000Z",
    "subject": "ord_01G8AHAFDJ7FV2Y77FVWA19009",
    "source": "org:org_KzSVZBQixLRkqj5d",
    "data": {
        "id": "ord_01G8AHAFDJ7FV2Y77FVWA19009",
        "externalId": "1234",
        "patient": {
            "id": "pat_ieUv67viS0lG18JN",
            "externalId": "1234"
        }
    }
}
```

***

## photon:order:rerouted

An order was routed to a different pharmacy.

#### Schema

| Param      | Type   | Description                                                        |
| :--------- | :----- | :----------------------------------------------------------------- |
| id         | string | Internal Photon ID for the order                                   |
| externalId | string | External ID passed in during order creation                        |
| pharmacy   | Object | Object containing data about the pharmacy the order was sent to    |
| patient    | Object | Object containing the Photon ID and the external id of the patient |

#### Sample Event

```json
{
    "id": "01G54ZB2Y82V0W67G8M2VW8WEQ",
    "type": "photon:order:rerouted",
    "specversion": "1.0",
    "datacontenttype": "application/json",
    "time": "2022-01-01T01:00:00.000Z",
    "subject": "ord_01G8AHAFDJ7FV2Y77FVWA19009",
    "source": "org:org_KzSVZBQixLRkqj5d",
    "data": {
        "id": "ord_01G8AHAFDJ7FV2Y77FVWA19009",
        "externalId": "1234",
        "pharmacy":{
            "id": "phr_hRBVwyp23qjQR0ap",
            "name": "CVS",
            "address": {
              "street1": "123 Main St",
              "street2": null,
              "city": "Brooklyn",
              "state": "NY",
              "postalCode": "11111"
            }
        },
        "patient": {
            "id": "pat_ieUv67viS0lG18JN",
            "externalId": "1234"
        }
    }
}
```

***