Hi guys,
Seems like the model in the Shipment Update Webhook documentation is not complete.
The model I had to use is the following (in pydantic):
SUW stands for Shipment Update Webhook
class SUWFulfillmentLineItem(BaseModel):
id: str
shiphero_id: int
quantity: int
sku: str
serial_numbers: List
customs_description: Any
package: str
lot_id: Any
lot_name: Any
lot_expiration: Any
class SUWLineItem(BaseModel):
line_item_id: int
partner_line_item_id: str
sku: str
product_name: str
customs_description: Any
tariff_code: str
price: float
quantity: int
weight: int
customs_value: int
ignore_on_customs: bool
country_of_manufacture: str
lot_id: Any
lot_name: Any
lot_expiration: str
class SUWShippingAddress(BaseModel):
name: str
address1: str
address2: str
address_city: str
address_zip: str
address_state: str
address_country: str
class SUWFulfillmentPackage(BaseModel):
length: float
width: float
height: float
weight: float
class SUWShippingLabel(BaseModel):
shipping_carrier: str
shipping_method: str
shipping_name: str
cost: float
tracking_number: str
tracking_url: str
class SUWPackage(BaseModel):
name: str
weight_in_oz: float
width: float
length: float
height: int
line_items: List[SUWLineItem]
shipping_label: SUWShippingLabel
shipping_address: SUWShippingAddress
box_code: str
box_id: int
box_name: str
class SUWFulfillment(BaseModel):
shipment_id: int
shipment_uuid: str
warehouse: str
warehouse_id: int
warehouse_uuid: str
webhook_type: str
partner_order_id: str
order_number: str
tracking_number: str
line_items: List[SUWFulfillmentLineItem]
custom_tracking_url: str
package_number: Optional[int]
total_packages: Optional[int]
shipping_method: str
shipping_carrier: str
shipping_address: SUWShippingAddress
package: SUWFulfillmentPackage
completed: bool
created_at: str
order_uuid: str
order_gift_note: str
class SUWRequest(BaseModel):
test: str
webhook_type: str
fulfillment: SUWFulfillment
total_packages: Optional[int]
packages: Optional[List[SUWPackage]]
Would it be possible to update the documentation?
Thank you,