package sale_order

import (
	"net/http"

	"github.com/go-chi/chi/v5"
)

func (s *Service) getApiOrderID(r *http.Request) string {
	if s.configs.GetConfigurations().CallistoSO.Enabled {
		if orderID := getLegacyOrderID(r.Context()); orderID != "" {
			return orderID
		}
	}
	return chi.URLParam(r, "order_reference")
}
