diff --git a/api/handlers/orders.go b/api/handlers/orders.go index e040110..0b019ba 100644 --- a/api/handlers/orders.go +++ b/api/handlers/orders.go @@ -185,15 +185,16 @@ func (h *OrderHandler) PurchaseLabel(w http.ResponseWriter, r *http.Request) { return } - if order.Status != models.OrderStatusPaid { - utils.RespondError(w, http.StatusConflict, "INVALID_STATE", "only paid orders can be labeled", nil) - return - } if order.TrackingNumber != "" { utils.RespondError(w, http.StatusConflict, "ALREADY_LABELED", "order already has a tracking number", nil) return } + if order.Status != models.OrderStatusPaid { + utils.RespondError(w, http.StatusConflict, "INVALID_STATE", "only paid orders can be labeled", nil) + return + } + // Coffee.Ounces in ounces; shippo client expects kg const ozToKg = 0.0283495 const defaultOunces = 12.0