Files
Assemblr-Backend/sipro/api/printing.py

16 lines
441 B
Python

from io import BytesIO
from flask import send_file
from requests import Response
from sipro.api.client import get_client
client = get_client()
router = '/printing'
def get_label(order_product_id: str, label_format:str='pdf') -> BytesIO:
method = f'{router}/getLabel?orderId={order_product_id}&format={label_format}'
response: Response = client.method('GET', method, raw=True)
data = BytesIO(response.content)
return data