Trendyol Order Acknowledgment
Version | Date | Created / Updated | Notes |
---|---|---|---|
v1.0 | Hristiyan Georgiev | Initial version |
Picking update
The idea of this call is to mark an order that has been taken in a picking status by the Seller on Trendyol. This works kind of like acknowledgement on other marketplaces - with the picking status we acknowledge the order and notify Trendyol that the warehouse have started picking the items. So having said this, we want to use our acknowledgment functionality, meaning that we will have the option to automatically or manually mark orders as picked.
All triggers, validations, standardizations etc which are not specifically mentioned here are as per the abstraction - Order Acknowledgement Functional Details
API Call: PUT /integration/order/sellers/{sellerId}/shipment-packages/{packageId}
Example call:
{
"lines": [{
"lineId": 8960442,
"quantity": 3
}],
"params": {},
"status": "Picking"
}
Mapping:
Trendyol Field | MC Pro Mapping | Notes | |
---|---|---|---|
lines |
N/A | ||
lineId |
Product In Order > Order Item Line ID |
||
quantity |
This should be calculated based on how many quantity we are acknowledging. We should count the Order Acknowledgement Row Lines with Acknowledgement Action = Accept |
||
params |
N/A | ||
status |
Hard coded as “Picking” |
Example resonse : 200 OK
Once we have “picked” the order, we are to update all the statuses on the order/ordered items etc. in MC Pro according to our acknowledgment abstraction - Order Acknowledgement Functional Details
Cancel Package
As we know, Trendyol orders are based on packages, meaning that once an order is placed, it is assigned a single package, regardless of the number of products or quantities ordered. It's important to note that, in Trendyol's context, a "package" does not refer to a single physical package, but rather the entire order's shipment ID, if we may put it that way.
This means that if we are unable to fulfill a product or part of its quantity for any reason and we can cancel it. Upon cancelling, the unfulfilled product (or quantity) will remain in the cancelled package while the remaining fulfillable products will be moved into a brand new package which we then need to store the new package ids.
We want to incorporate our acknowledgment functionality so when we have rejected products we just cancel them and exclude from the package. All triggers, validations, standardizations etc which are not specifically mentioned here are as per the abstraction - Order Acknowledgement Functional Details
API Call: PUT /integration/order/sellers/{sellerId}/shipment-packages/{packageId}/items/unsupplied
API Docs: https://developers.trendyol.com/int/docs/international-marketplace/international-order-v2/int-cancelPackage
The sellerId
we should pick from Channel Trendyol
> Supplier ID
and the packageId
we pick from Product In Order Line
> Package ID
for the product that we want to split.
We should be looking for a record in Order Acknowledgment
with Action
= Reject.
Example call body :
{
"lines": [
{
"lineId": 8980620,
"quantity": 1
}
],
"reasonId":500,
"shouldKeepPreviousStatus": true
}
Mapping :
Trendyol field | MC Pro Field | Notes | |
---|---|---|---|
lines |
|||
lineId |
Product In Order > Order Item Line ID |
This is the the line id as received in the order. We need to map to it from the Order Acknowledgement Rows to obtain it | |
quantity |
We should count the Order Acknowledgement Row Lines with Acknowledgement Action = Reject |
||
reasonId |
Hardcoded as “500” | ||
shouldKeepPreviousStatus |
Hardcoded as “true” |
Example response : 200 OK
The tricky part is that after cancelling part of the package, we don't receive the new package IDs in the responses. Instead, we need to make a Get Shipment Packages call (essentially our "get orders" call) to retrieve the new IDs and update them across the products. It's important to note that Trendyol maintains a history of all packages and their statuses, linking this information with the rest of the order details, such as shipping/billing addresses and ordered items. As a result, we will have the same order information multiple times for the different packages.
We also want to create a Refund on a Completed status in MC Pro for the line(s) that have been rejected.
Get Shipment Packages IDs
I suggest that we incorporate this call with the cancellation call, so we do this call straight after to obtain the new IDs. ‼Note : During testing I found that even though the communication is synchronous, it takes a few seconds until the splitted IDs are returned in the API so we should incorporate some kind of 10 second throttle. Trendyol confirmed this could happen on prod as well, as there are many operations that proceed while splitting the package hence the small delay.
API Call: GET /integration/order/sellers/{sellerId}/orders?status=Created,Picking,Invoiced&orderNumber={orderID}
We are using these specific statuses as we don’t want to receive the old package ids in the response. We only need the new ones.
The sellerId
we should pick from Channel Trendyol
> Supplier ID
and the orderId
we pick from Orders
> Marketplace Order ID
Sample response :
{
"totalElements": 2,
"totalPages": 1,
"page": 0,
"size": 50,
"content": [
{
"shipmentAddress": {
"id": 15584446,
"firstName": "Vasil",
"lastName": "Iliev",
"company": "VIS-2",
"address1": "Yordan Yosifov 21",
"address2": "",
"city": "Sofia",
"cityCode": 6,
"district": "Sofia",
"districtId": 6,
"countyId": 0,
"countyName": "",
"shortAddress": "",
"stateName": "",
"addressLines": {
"addressLine1": "",
"addressLine2": ""
},
"postalCode": "23318",
"countryCode": "AE",
"neighborhoodId": 5198,
"neighborhood": "Boyana",
"phone": "97165324075",
"fullAddress": "Yordan Yosifov 21 Bina No:1 Daire:2 Sofia Oms Address Description",
"fullName": "Vasil Iliev"
},
"orderNumber": "1536793539",
"grossAmount": 349.00,
"totalDiscount": 0.00,
"totalTyDiscount": 0.00,
"taxNumber": null,
"invoiceAddress": {
"id": 15584445,
"firstName": "Vasil",
"lastName": "Iliev",
"company": "",
"address1": "Yordan Yosifov",
"address2": "address 2",
"city": "Sofia",
"cityCode": 6,
"district": "Sofia",
"districtId": 6,
"countyId": 0,
"countyName": "",
"shortAddress": "",
"stateName": "",
"addressLines": {
"addressLine1": "",
"addressLine2": ""
},
"postalCode": "23318",
"countryCode": "AE",
"neighborhoodId": 5198,
"neighborhood": "Boyana",
"phone": "97165324075",
"fullAddress": "Yordan Yosifov address 2 Sofia Oms Core Team",
"fullName": "Vasil Iliev"
},
"customerFirstName": "Vasil",
"customerEmail": "pf+dov9ry5o@trendyolmail.com",
"customerId": 21823399,
"customerLastName": "Iliev",
"id": 60305398,
"cargoTrackingNumber": 2200105845,
"cargoProviderName": "ARAMEX",
"lines": [
{
"quantity": 1,
"salesCampaignId": 1741790951,
"productSize": "M",
"merchantSku": "STK-FR24-00000061-M",
"productName": "Floral print dress",
"productCode": 123123,
"merchantId": 875827,
"amount": 349.00,
"discount": 0.00,
"tyDiscount": 0.00,
"discountDetails": [
{
"lineItemPrice": 349.00,
"lineItemDiscount": 0.00,
"lineItemTyDiscount": 0.00
}
],
"currencyCode": "AED",
"productColor": "White",
"id": 8973011,
"sku": "FR24-00000061-M",
"vatBaseAmount": 5.00,
"barcode": "FR24-00000061-M",
"orderLineItemStatusName": "ReadyToShip",
"price": 349.00,
"fastDeliveryOptions": []
}
],
"orderDate": 1742569857085,
"tcIdentityNumber": "11111111111",
"identityNumber": "11111111111",
"currencyCode": "AED",
"packageHistories": [
{
"createdDate": 1742570053236,
"status": "Created"
}
],
"shipmentPackageStatus": "ReadyToShip",
"status": "Created",
"deliveryType": "normal",
"timeSlotId": 0,
"estimatedDeliveryStartDate": 0,
"estimatedDeliveryEndDate": 0,
"totalPrice": 349.00,
"deliveryAddressType": "Shipment",
"agreedDeliveryDate": 1742915464861,
"fastDelivery": false,
"originShipmentDate": 1742569857267,
"lastModifiedDate": 1742570053236,
"commercial": false,
"fastDeliveryType": "",
"deliveredByService": false,
"agreedDeliveryDateExtendible": false,
"extendedAgreedDeliveryDate": 0,
"agreedDeliveryExtensionEndDate": 0,
"agreedDeliveryExtensionStartDate": 0,
"warehouseId": 893963,
"groupDeal": false,
"micro": false,
"giftBoxRequested": false,
"3pByTrendyol": false,
"containsDangerousProduct": false
},
{
"shipmentAddress": {
"id": 15584446,
"firstName": "Vasil",
"lastName": "Iliev",
"company": "VIS-2",
"address1": "Yordan Yosifov 21",
"address2": "",
"city": "Sofia",
"cityCode": 6,
"district": "Sofia",
"districtId": 6,
"countyId": 0,
"countyName": "",
"shortAddress": "",
"stateName": "",
"addressLines": {
"addressLine1": "",
"addressLine2": ""
},
"postalCode": "23318",
"countryCode": "AE",
"neighborhoodId": 5198,
"neighborhood": "Boyana",
"phone": "97165324075",
"fullAddress": "Yordan Yosifov 21 Bina No:1 Daire:2 Sofia Oms Address Description",
"fullName": "Vasil Iliev"
},
"orderNumber": "1536793539",
"grossAmount": 349.00,
"totalDiscount": 0.00,
"totalTyDiscount": 0.00,
"taxNumber": null,
"invoiceAddress": {
"id": 15584445,
"firstName": "Vasil",
"lastName": "Iliev",
"company": "",
"address1": "Yordan Yosifov",
"address2": "address 2",
"city": "Sofia",
"cityCode": 6,
"district": "Sofia",
"districtId": 6,
"countyId": 0,
"countyName": "",
"shortAddress": "",
"stateName": "",
"addressLines": {
"addressLine1": "",
"addressLine2": ""
},
"postalCode": "23318",
"countryCode": "AE",
"neighborhoodId": 5198,
"neighborhood": "Boyana",
"phone": "97165324075",
"fullAddress": "Yordan Yosifov address 2 Sofia Oms Core Team",
"fullName": "Vasil Iliev"
},
"customerFirstName": "Vasil",
"customerEmail": "pf+g9b4raqy@trendyolmail.com",
"customerId": 21823399,
"customerLastName": "Iliev",
"id": 60305397,
"cargoTrackingNumber": 2200105844,
"cargoProviderName": "ARAMEX",
"lines": [
{
"quantity": 1,
"salesCampaignId": 1741790951,
"productSize": "M",
"merchantSku": "STK-FR24-00000061-M",
"productName": "Floral print dress",
"productCode": 123123,
"merchantId": 875827,
"amount": 349.00,
"discount": 0.00,
"tyDiscount": 0.00,
"discountDetails": [
{
"lineItemPrice": 349.00,
"lineItemDiscount": 0.00,
"lineItemTyDiscount": 0.00
}
],
"currencyCode": "AED",
"productColor": "White",
"id": 8973011,
"sku": "FR24-00000061-M",
"vatBaseAmount": 5.00,
"barcode": "FR24-00000061-M",
"orderLineItemStatusName": "ReadyToShip",
"price": 349.00,
"fastDeliveryOptions": []
}
],
"orderDate": 1742569857085,
"tcIdentityNumber": "11111111111",
"identityNumber": "11111111111",
"currencyCode": "AED",
"packageHistories": [
{
"createdDate": 1742570053235,
"status": "Created"
}
],
"shipmentPackageStatus": "ReadyToShip",
"status": "Created",
"deliveryType": "normal",
"timeSlotId": 0,
"estimatedDeliveryStartDate": 0,
"estimatedDeliveryEndDate": 0,
"totalPrice": 349.00,
"deliveryAddressType": "Shipment",
"agreedDeliveryDate": 1742915464861,
"fastDelivery": false,
"originShipmentDate": 1742569857267,
"lastModifiedDate": 1742570053235,
"commercial": false,
"fastDeliveryType": "",
"deliveredByService": false,
"agreedDeliveryDateExtendible": false,
"extendedAgreedDeliveryDate": 0,
"agreedDeliveryExtensionEndDate": 0,
"agreedDeliveryExtensionStartDate": 0,
"warehouseId": 893963,
"groupDeal": false,
"micro": false,
"giftBoxRequested": false,
"3pByTrendyol": false,
"containsDangerousProduct": false
}
]
}
From the response, the only mapping required is the content
> id
and cargoTrackingNumber
, which corresponds to our package ID and the new carrier tracking number for the splitted package:
Trendyol Field | Hemi Field | |
---|---|---|
content |
||
id |
Product In Order Line > Package ID |
|
cargoTrackingNumber |
Product In Order Line > Shipping Tracking Number |
Along with the ID, we will receive a lines
object indicating which lines are associated with this ID. We could use the lines
> id
to map with Product In Order
> Order Item Line ID
to understand which is the product that we need to update.