Purchase order events

Note

These events are not triggered in the Orders (Beta). View events for Orders (Beta) here.

purchase_order.created

Example
Copy
Copied
{
	"1": {
		"id": "0eb21d18-6c44-4865-a68e-db902e9e5e9c",
		"source": "SHIPWELL_WEB",
		"status": "",
		"company": {
			"id": "a54ef012-77d4-44a0-8ba5-115b09b655be",
			"self_link": "/v2/companies/a54ef012-77d4-44a0-8ba5-115b09b655be/",
			"resource_type": "company"
		},
		"archived": false,
		"shipment": null,
		"self_link": "/v2/purchase-orders/0eb21d18-6c44-4865-a68e-db902e9e5e9c/",
		"tax_amount": null,
		"description": null,
		"origin_stop": null,
		"order_number": "MM-5676",
		"customer_name": "Workforce",
		"resource_type": "purchase_order",
		"supplier_name": "Flowers by Cindy",
		"origin_address": {
			"city": "Austin",
			"country": "US",
			"latitude": 30.3441591,
			"timezone": "America/Chicago",
			"longitude": -97.7699996,
			"postal_code": "78731",
			"phone_number": null,
			"address_line_1": "5811 Mesa Dr",
			"address_line_2": null,
			"state_province": "TX"
		},
		"created_by_user": {
			"id": "75a0a1b2-97f4-4d33-858e-eab49c3159b5",
			"self_link": "/v2/companies/a54ef012-77d4-44a0-8ba5-115b09b655be/users/75a0a1b2-97f4-4d33-858e-eab49c3159b5/",
			"resource_type": "user"
		},
		"subtotal_amount": null,
		"destination_stop": null,
		"source_system_id": null,
		"destination_address": {
			"city": "Austin",
			"country": "US",
			"latitude": 30.3539143,
			"timezone": "America/Chicago",
			"longitude": -97.68906679999999,
			"postal_code": "78753",
			"phone_number": null,
			"address_line_1": "9001 N Interstate Hwy 35",
			"address_line_2": "Unit 110",
			"state_province": "TX"
		},
		"invoice_external_id": null,
		"tax_amount_currency": null,
		"customer_external_id": null,
		"supplier_external_id": null,
		"actual_pickup_datetime": null,
		"origin_dock_external_id": null,
		"actual_delivery_datetime": null,
		"subtotal_amount_currency": null,
		"planned_pickup_end_datetime": null,
		"destination_dock_external_id": null,
		"planned_delivery_end_datetime": null,
		"planned_pickup_start_datetime": null,
		"origin_appointment_external_id": null,
		"planned_delivery_start_datetime": null,
		"destination_appointment_external_id": null
	}
}

purchase_order.updated

Example
Copy
Copied
{
	"1": {
		"id": "713c88ed-1dde-49cf-a0fd-ba5c40ca09b4",
		"new_data": {
			"origin_stop": {
				"id": "b9d2f7f9-9c29-4933-b2c1-91911530aef9",
				"self_link": "/v2/shipments/6139251e-5066-4169-8d0f-2d619e1b1082/stops/b9d2f7f9-9c29-4933-b2c1-91911530aef9/",
				"resource_type": "stop"
			},
			"destination_stop": {
				"id": "b1c1b8a7-f471-4413-9949-ae23c3234b9a",
				"self_link": "/v2/shipments/6139251e-5066-4169-8d0f-2d619e1b1082/stops/b1c1b8a7-f471-4413-9949-ae23c3234b9a/",
				"resource_type": "stop"
			}
		},
		"old_data": {
			"origin_stop": null,
			"destination_stop": null
		},
		"self_link": "/v2/purchase-orders/713c88ed-1dde-49cf-a0fd-ba5c40ca09b4/",
		"resource_type": "purchase_order"
	}
}

purchase_order.deleted

Example
Copy
Copied
{
  "id": "01GQQ6V8ZN6CPRFFPMZD47YRMJ",
  "occurred_at": "2023-01-26T14:14:00.780413+00:00",
  "source": {
    "user_id": "f0b979c9-28e2-41d6-883e-cb1f5c320bb4",
    "company_id": "a54ef012-77d4-44a0-8ba5-115b09b655be",
    "request_id": "fb545155-03b1-440a-8eeb-d652eb2fc07c",
    "publishing_system": "backend",
    "environment": "prod"
  },
  "event_name": "purchase_order.deleted",
  "details": {
    "id": "1ee262c7-f860-4dd6-8840-f11d7d385240",
    "resource_type": "purchase_order"
  }
}

purchase_order.line_item.created

Example
Copy
Copied
{
  "id": "01GQQ6AJB28MCWZKJ9DMT31H96",
  "occurred_at": "2023-01-26T14:04:53.280722+00:00",
  "source": {
    "user_id": "user_id",
    "company_id": "company_id",
    "request_id": "947f3b5d-0c0d-484f-b009-53ce682b4735",
    "publishing_system": "backend",
    "environment": "prod"
  },
  "event_name": "purchase_order.line_item.created",
  "details": {
    "id": "159db1d1-8389-4345-952f-adf3b7d33e3f",
    "width": 14,
    "height": 14,
    "length": 14,
    "self_link": "/v2/purchase-orders/1ee262c7-f860-4dd6-8840-f11d7d385240/line-items/159db1d1-8389-4345-952f-adf3b7d33e3f/",
    "stackable": false,
    "temp_unit": "F",
    "piece_type": "BAG",
    "updated_at": "2023-01-26T14:04:53.392046Z",
    "custom_data": {
      "shipwell_custom_data": {
        "05d2d8b2-ace6-4e19-8c39-c49500ae2121": null,
        "851481f7-2b60-4b8d-aafd-857e750b3ff7": null
      }
    },
    "description": "Multi-lateral Rustic Wooden Fish - Metal fuchsia - iod-vie",
    "length_unit": "IN",
    "product_ref": "Multi-lateral Rustic Wooden Fish",
    "weight_unit": "LB",
    "package_type": "BAG",
    "total_pieces": null,
    "freight_class": null,
    "nmfc_sub_code": null,
    "resource_type": "purchase_order_line_item",
    "nmfc_item_code": null,
    "package_weight": 14,
    "total_packages": null,
    "value_per_piece": 149,
    "hazmat_hazard_class": null,
    "hazmat_packing_group": null,
    "refrigeration_max_temp": null,
    "refrigeration_min_temp": null,
    "refrigeration_required": false,
    "total_line_item_weight": 14,
    "value_per_piece_currency": "USD",
    "hazmat_proper_shipping_name": null,
    "provider_specific_packaging": null,
    "hazmat_identification_number": null
  }
}

purchase_order.line_item.updated

Example
Copy
Copied
{
   "id":"01HC15K01TGA7M4M58K6AXG449",
   "occurred_at":"2024-10-06T00:18:21.684836Z",
   "event_name":"purchase_order.line_item.updated",
   "self_link":"/v2/purchase-orders/ef68e921-e0ec-4b04-84e8-2d22c381cb05/line-items/15ec1a92-5a81-4f47-8da1-0e2521892afb/",
   "resource_type":"line_item",
   "source":{
      "publishing_system":"backend",
      "company_id":"a54ef012-77d4-44a0-8ba5-115b09b655be",
      "user_id":"a8497882-4b9d-4919-a4f1-1ce3adb48e63",
      "request_id":"ce1c06c6-ad0f-4d87-a28d-b1223d8d6b21"
   },
   "details":{
      "id":"15ec1a92-5a81-4f47-8da1-0e2521892afb",
      "new_data":{
         "width":48.0,
         "height":null,
         "length":40.0,
         "updated_at":"2024-10-06T00:18:21.750146Z",
         "custom_data":{
            "custom_fields":{
               
            },
            "shipwell_custom_data":{
               "05d2d8b2-ace6-4e19-8c39-c49500ae2121":null,
               "851481f7-2b60-4b8d-aafd-857e750b3ff7":null,
               "b859e43b-2bbc-4d64-ab1d-6b227a17a75c":null
            }
         },
         "length_unit":"IN",
         "package_type":"PLT"
      },
      "old_data":{
         "width":null,
         "height":null,
         "length":null,
         "updated_at":"2024-10-05T23:45:53.337856Z",
         "custom_data":{
            "custom_fields":{
               "abc123":"321bca"
            },
            "shipwell_custom_data":{
               "05d2d8b2-ace6-4e19-8c39-c49500ae2121":null,
               "851481f7-2b60-4b8d-aafd-857e750b3ff7":null,
               "b859e43b-2bbc-4d64-ab1d-6b227a17a75c":null
            }
         },
         "length_unit":"IN",
         "package_type":null
      }
   }
}

purchase_order.line_item.deleted

Example
Copy
Copied
{
   "id":"01HCHHW60HZQQZ9X1JDC60J1B2",
   "occurred_at":"2024-10-12T09:00:56.602409Z",
   "event_name":"purchase_order.line_item.deleted",
   "details":{
      "id":"034cf919-4fb6-403b-8280-950377461a87",
      "self_link":"/v2/purchase-orders/a985427c-417b-416c-8b86-bfad053b9b9c/line-items/034cf919-4fb6-403b-8280-950377461a87/",
      "resource_type":"line_item",
      "purchase_order_id":"a985427c-417b-416c-8b86-bfad053b9b9c"
   },
   "source":{
      "publishing_system":"backend",
      "company_id":"a54ef012-77d4-44a0-8ba5-115b09b655be",
      "user_id":"6c6c4b38-ac30-46a1-be94-b892921267fa",
      "request_id":"505e91e1-03e9-46c5-bcb5-46f04dcea7e2"
   }
}

purchase_order.attached_with_shipment

Note

The purchase_order.attached_with_shipment is triggered when an order is added to a shipment. A forthcoming purchase_order.detached_from_shipment event will be triggered when an order is removed from a shipment.

Example
Copy
Copied
{
   "id":"01HDEN9BR05AF40Q33EHVYNYWS",
   "occurred_at":"2024-10-23T16:18:32.789493Z",
   "event_name":"purchase_order.attached_with_shipment",
   "details":{
      "id":"0421de4a-5f8a-4099-b584-f17762ebdac5",
      "shipment_id":"d4ad7741-b010-4eda-8a10-95442359f6c0",
      "order_number":"OPT0388",
      "resource_type":"purchase_order",
      "origin_stop_id":"58efda75-5abf-40aa-915e-b7c9a76debf0",
      "destination_stop_id":"6238abb0-c7e5-48af-ae20-9932bb71864b"
   },
   "source":{
      "publishing_system":"backend",
      "company_id":"a54ef012-77d4-44a0-8ba5-115b09b655be",
      "user_id":null,
      "request_id":null
   }
}

purchase_order.detached_from_shipment

Note

The purchase_order.detached_from_shipment event is coming soon. The purchase_order.detached_from_shipment is triggered when an order is removed from a shipment.

Example
Copy
Copied
{
   "id":"01HDEN9BR05AF40Q33EHVYNYWS",
   "occurred_at":"2024-10-23T16:18:32.789493Z",
   "event_name":"purchase_order.detached_from_shipment",
   "details":{
      "id":"0421de4a-5f8a-4099-b584-f17762ebdac5",
      "shipment_id":"d4ad7741-b010-4eda-8a10-95442359f6c0",
      "order_number":"OPT0388",
      "resource_type":"purchase_order",
      "origin_stop_id":"58efda75-5abf-40aa-915e-b7c9a76debf0",
      "destination_stop_id":"6238abb0-c7e5-48af-ae20-9932bb71864b"
   },
   "source":{
      "publishing_system":"backend",
      "company_id":"a54ef012-77d4-44a0-8ba5-115b09b655be",
      "user_id":null,
      "request_id":null
   }
}
Copyright © Shipwell 2024. All right reserved.