Trendyol Get Label
Version | Date | Created / Updated | Notes |
---|---|---|---|
1.0 | 28.05.2025 | Danail Deltchev | First Publish |
The purpose of this page is to describe how we are going to obtain a label in MCP for Trendyol orders
As we already know Trendyol orders work on packages. Originally all items are placed in one package (that’s how we receive it from Trendyol). This original package can be split if we want for multiple different reasons - partial fulfilment, partial refunds, etc.
In the beginning we will NOT support partial packaging on Trendyol. Our flow includes Acceptance at which point if there are any changes to the package (due to Rejected items) they will be tracked and then we can proceed with the shipment (pick / pack / label request, etc. whatever we want 🙂)
To be better prepared for future splits and to be able to track information the right way according to Marketplace availability we are storing and working with the package ID from the Order Item Line level (as described in the Get Orders document). Information kept this way is package ID and cargoTrackingNumber which is the ID we will need to use to call for a label download.
Based on all of the above just to confirm - to start we expect to have only ONE package ID on each order
When this functionality is started it should either select all available orders OR be able to receive a parameter for a specific Order ID to select and check. Both for all or for the single ID the requirements are like this:
- Order/s should be on a Ready For Shipping tool status
- Order/s should have
Product In Order Line
>Shipping Tracking Number
filled in - Order/s should have a Label Request created for a courier “Trendyol” on status “Pending”
- IF there is a Label Request with courier “Trendyol” already on status “Ready” we should put the new “Pending” label to Error with message “Duplicated Label Request for Trendyol”
- IF there are multiple Label Requests with courier “Trendyol” that are on status “Pending” we should pick the Largest ID and set all others to Error with message “Duplicated Label Request for Trendyol”
API Call: https://apigw.trendyol.com/integration/sellers/{sellerId}/common-label/query?id={cargoTrackingNumber}
Method: GET
Example Response:
{
"data": [
{
"format": "PDF",
"label": "https://aramex.net/content/rpt_cache/d1525da8fe0f49a6b47d712495520200.pdf" //example model
}
]
}
Expectation is when we have an order (or multiple orders) to get label for, we will make the call and upon success update the Label Request record in MCP with status “Ready” and then store the sub record to the Label Request > Label Request Document where “Document type” should be “Label” and the filename should be the local storage of the PDF as received from the label request to Trendyol (field label
from the JSON above for the path to download the label)
If the call is unsuccessful we should update the Label Request with status “Error” and then store the error both in the Label Request
> Error message
and in Order Error with type “Label”