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 | 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
{
"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
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
{
"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"
}
}
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
{
"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
{
"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
{
"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
{
"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",
"country": "US",
"postalCode": "11111",
},
"patient": {
"id": "pat_ieUv67viS0lG18JN",
"externalId": "1234"
}
}
}
photon:order:error
There was an error while processing the order
Schema
Param | Type | Description |
---|---|---|
id | string | Internal Photon ID for the order |
externalId | string | External ID passed in during order creation |
reason | string | Description of the error |
patient | Object | Object containing the Photon ID and the external id of the patient |
Sample Event
{
"id": "01G54ZB2Y82V0W67G8M2VW8WEQ",
"type": "photon:order:error",
"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",
"reason": "EXAMPLE REASON",
"patient": {
"id": "pat_ieUv67viS0lG18JN",
"externalId": "1234"
}
}
}
Updated over 1 year ago