34 lines
1.1 KiB
Python
34 lines
1.1 KiB
Python
from typing import Dict, Any, List
|
|
from ..client import OzonClient
|
|
|
|
class FBSService:
|
|
"""Service to handle FBS (Fulfillment by Seller) operations."""
|
|
|
|
def __init__(self, client: OzonClient):
|
|
self.client = client
|
|
|
|
def get_unfulfilled_list(self, dir: str = "ASC", filter_params: Dict[str, Any] = None, limit: int = 100, offset: int = 0) -> Dict[str, Any]:
|
|
"""
|
|
Get a list of new/unfulfilled FBS orders.
|
|
Endpoint: /v3/posting/fbs/unfulfilled/list
|
|
"""
|
|
payload = {
|
|
"dir": dir,
|
|
"filter": filter_params or {},
|
|
"limit": limit,
|
|
"offset": offset,
|
|
"with": {
|
|
"analytics_data": True,
|
|
"barcodes": True,
|
|
"financial_data": True
|
|
}
|
|
}
|
|
return self.client.post("/v3/posting/fbs/unfulfilled/list", data=payload)
|
|
|
|
def ship_packages(self, packages: List[Dict[str, Any]]) -> Dict[str, Any]:
|
|
"""
|
|
Ship unfulfilled orders.
|
|
Endpoint: /v3/posting/fbs/ship
|
|
"""
|
|
return self.client.post("/v3/posting/fbs/ship", data={"packages": packages})
|