Trendyol Get Orders
Version | Date | Created / Updated | Notes |
---|---|---|---|
v1.0 | Hristiyan Georgiev | Initial version | |
v1.1 | 04.06.2025 | Milen Markov | Changes due to OMSPro (Puma) |
v1.2 | 13.06.2025 | HristiyanCHO | Added logic for get orders handle |
Trendyol orders work on the basis of packages. An order comes in the same package with the option to split it off if needed or the Seller to update and make multiple packages to the same order ID. If nothing like this happens the whole order should stay in the same package
The marketplace also has an “Awaiting” status which, similar to Amazon’s “pending”, allows the buyer to change their mind or is still waiting payment. Meaning while an order is on an “Awaiting” status we want to store it for the purpose of deducting the stock value (Awaiting is = to our “pending”) but do nothing else with it until it is updated to a future status. Infact any PII info will be masked when getting the order in Awaiting status, so once the order status changes , we should be prepared to overwrite. The next status after Awaiting is Created and when we have the order on this status it means it is ready.
All validations, triggers and standardizations which are not mentioned here are as per Order management general requirements
API Call: GET /integration/order/sellers/{{supplierId}}/orders?status=Created,Picking,Invoiced,Shipped,Cancelled,Shipped,Delivered,UnDelivered,Returned,Repack,UnSupplied
Thre are a number of parameters available for filter, but the ones that we need are startDate
, supplierId
, status
page
and size
.
For startDate
we want to use the last_date_run
table. The first run will check for new orders in the last 90 days and afterwards we will get the date from last_date_run
table and filter orders using the paremeter. We want to overlap the time with 1 hour, meaning that we should use the time of last_date_run
- 1 hour. The startDate also works as modified date on Trendyol so we will always get updated orders. Which means this call should serve as modified orders download too, overwriting any changed information on the order.
The supplierId
we should pick from Channel Trendyol
> Supplier ID
For status we want to push hardcoded values of : “Awaiting,Created,Picking,Invoiced,Shipped,Cancelled,Shipped,Delivered,UnDelivered,Returned,Repack,UnSupplied” . The reason we do this is because we need to ignore/exclude one particular status = UnPacked, however the filter does not work on exclude basis.
We also have availability for pagination through a page
parameter so we need to handle this and call pages if in any case we have more than 1.
<v1.2>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. For example if we have an order with 3 products and one of them was cancelled by the buyer pre-shipment, we will receive the original order and its package with all 3 items cancelled, and in the same payload we will have the order once again with the remaining 2 items that are to be shipped. So we need to create a logic to handle this and keep the latest updated info on the order.</v1.2>
Example response for “Awaiting” order status. This is the point where we create the order in Hemi on “Pending” with the masked info :
{
"totalElements": 1,
"totalPages": 1,
"page": 0,
"size": 50,
"content": [
{
"shipmentAddress": {
"id": 0,
"firstName": "***",
"lastName": "***",
"company": "VIS-2",
"address1": "***",
"address2": "***",
"city": "***",
"cityCode": 0,
"district": "***",
"districtId": 0,
"countyId": 0,
"countyName": "***",
"shortAddress": "***",
"stateName": "***",
"addressLines": {
"addressLine1": "***",
"addressLine2": "***"
},
"postalCode": "***",
"countryCode": "***",
"neighborhoodId": 5198,
"neighborhood": "Boyana",
"phone": "***",
"fullAddress": "***",
"fullName": "***"
},
"orderNumber": "2065204852",
"grossAmount": 200.54,
"totalDiscount": 0.00,
"totalTyDiscount": 0.00,
"taxNumber": "***",
"invoiceAddress": {
"id": 0,
"firstName": "***",
"lastName": "***",
"company": "",
"address1": "***",
"address2": "***",
"city": "***",
"cityCode": 0,
"district": "***",
"districtId": 0,
"countyId": 0,
"countyName": "***",
"shortAddress": "***",
"stateName": "***",
"addressLines": {
"addressLine1": "***",
"addressLine2": "***"
},
"postalCode": "***",
"countryCode": "***",
"neighborhoodId": 5198,
"neighborhood": "Boyana",
"phone": "***",
"fullAddress": "***",
"fullName": "***"
},
"customerFirstName": "***",
"customerEmail": "***",
"customerId": 0,
"customerLastName": "***",
"id": 0,
"cargoTrackingNumber": 0,
"cargoProviderName": "***",
"lines": [
{
"quantity": 1,
"salesCampaignId": 1022693461,
"productSize": "M",
"merchantSku": "STK-stokum-20",
"productName": "Babyhug Moisturising Milky Soap 75g, Glycerin & Wheat Germ Oil, Dermatologically Tested",
"productCode": 123123,
"merchantId": 875827,
"amount": 200.54,
"discount": 0.00,
"tyDiscount": 0.00,
"discountDetails": [
{
"lineItemPrice": 200.54,
"lineItemDiscount": 0.00,
"lineItemTyDiscount": 0.00
}
],
"currencyCode": "AED",
"productColor": "White",
"id": 8943758,
"sku": "34322043333",
"vatBaseAmount": 5.00,
"barcode": "34322043333",
"orderLineItemStatusName": "Approved",
"price": 200.54,
"fastDeliveryOptions": []
}
],
"orderDate": 1742328669171,
"tcIdentityNumber": "11111111111",
"currencyCode": "AED",
"packageHistories": [
{
"createdDate": 0,
"status": "Awaiting"
}
],
"shipmentPackageStatus": "Approved",
"status": "Awaiting",
"deliveryType": "normal",
"timeSlotId": 0,
"estimatedDeliveryStartDate": 0,
"estimatedDeliveryEndDate": 0,
"totalPrice": 200.54,
"deliveryAddressType": "Shipment",
"agreedDeliveryDate": 1742587869246,
"fastDelivery": false,
"originShipmentDate": 1742328669246,
"lastModifiedDate": 1742328669255,
"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
}
]
}
Example response for “Created” order status. Once we have this status we need to overwrite the masked info :
{
"totalElements": 1,
"totalPages": 1,
"page": 0,
"size": 50,
"content": [
{
"shipmentAddress": {
"id": 15532805,
"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": "1723816861",
"grossAmount": 200.54,
"totalDiscount": 0.00,
"totalTyDiscount": 0.00,
"taxNumber": null,
"invoiceAddress": {
"id": 15532804,
"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+d4o454ak@trendyolmail.com",
"customerId": 21823399,
"customerLastName": "Iliev",
"id": 60280564,
"cargoTrackingNumber": 2011260672,
"cargoProviderName": "ARAMEX",
"lines": [
{
"quantity": 1,
"salesCampaignId": 771788677,
"productSize": "M",
"merchantSku": "STK-stokum-20",
"productName": "Babyhug Moisturising Milky Soap 75g, Glycerin & Wheat Germ Oil, Dermatologically Tested",
"productCode": 123123,
"merchantId": 875827,
"amount": 200.54,
"discount": 0.00,
"tyDiscount": 0.00,
"discountDetails": [
{
"lineItemPrice": 200.54,
"lineItemDiscount": 0.00,
"lineItemTyDiscount": 0.00
}
],
"currencyCode": "AED",
"productColor": "White",
"id": 8943759,
"sku": "34322043333",
"vatBaseAmount": 5.00,
"barcode": "34322043333",
"orderLineItemStatusName": "ReadyToShip",
"price": 200.54,
"fastDeliveryOptions": []
}
],
"orderDate": 1742328676077,
"tcIdentityNumber": "11111111111",
"currencyCode": "AED",
"packageHistories": [
{
"createdDate": 1742328676149,
"status": "Awaiting"
},
{
"createdDate": 1742328688215,
"status": "Created"
}
],
"shipmentPackageStatus": "ReadyToShip",
"status": "Created",
"deliveryType": "normal",
"timeSlotId": 0,
"estimatedDeliveryStartDate": 0,
"estimatedDeliveryEndDate": 0,
"totalPrice": 200.54,
"deliveryAddressType": "Shipment",
"agreedDeliveryDate": 1742587888210,
"fastDelivery": false,
"originShipmentDate": 1742328676140,
"lastModifiedDate": 1742328688215,
"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
}
]
}
Mapping :
Trendyol field | MC Pro Field | Notes | ||||
---|---|---|---|---|---|---|
totalElements |
N/A | |||||
totalPages |
N/A | |||||
page |
N/A | |||||
size |
N/A | |||||
content |
||||||
shipmentAddress |
||||||
id |
Orders > Shipping Address ID |
|||||
firstName |
N/A | We receive the name in a different node so mapping is below. | ||||
lastName |
N/A | |||||
company |
Orders > Company Name |
|||||
address1 |
Orders > Shipping Street 1 |
If for some reason address1 is empty, we want to check for info in address2 and fill it in Shipping Street 1 . If both are empty then we act per the orders abstraction mentioned in the beginning of the document. |
||||
address2 |
Orders > Shipping Street 2 |
|||||
city |
Orders > Shipping City |
|||||
cityCode |
N/A | |||||
district |
N/A | |||||
districtId |
N/A | |||||
countyId |
N/A | |||||
countyName |
N/A | |||||
shortAddress |
N/A | |||||
stateName |
Orders > Shipping State Province |
|||||
addressLines |
||||||
addressLine1 |
N/A | |||||
addressLine2 |
N/A | |||||
postalCode |
Orders > Shipping Postal Code |
|||||
countryCode |
Orders > Shipping Country Code |
AND
Orders
> Shipping Country Name
| Since we don’t receive the country name in the response, we want to fill the Orders
> Shipping Country Name
from the country code. We will receive the ISO2 code of the country, but want to keep store the full country name. |
| | | neighborhoodId
| | | N/A | |
| | | neighborhood
| | | N/A | |
| | | phone
| | | Orders
> Shipping Phone
| <v1.1> if the field is empty, we hardcode value ‘+971 (50) 123-45-67’ </v1.1> |
| | | fullAddress
| | | N/A | |
| | | fullName
| | | Orders
> Shipping Buyer Name
| |
| | orderNumber
| | | | Orders
> Marketplace Order ID
| |
| | grossAmount
| | | | Orders
> Order Subtotal Amount
| |
| | totalDiscount
| | | | Orders
> Discount Value
| |
| | totalTyDiscount
| | | | N/A | |
| | taxNumber
| | | | N/A | |
| | invoiceAddress
| | | | | |
| | | id
| | | Orders
> Billing Adress ID
| |
| | | firstName
| | | | |
| | | lastName
| | | | |
| | | company
| | | Orders
> Company Name
| In the billing tab |
| | | address1
| | | Orders
> Billing Street 1
| If for some reason address1
is empty, we want to check for info in address2
and fill it in Billing Street 1
. If both are empty then we act per the orders abstraction mentioned in the beginning of the document. |
| | | address2
| | | Orders
> Billing Street 2
| |
| | | city
| | | Orders
> Billing City Name
| |
| | | cityCode
| | | N/A | |
| | | district
| | | N/A | |
| | | districtId
| | | N/A | |
| | | countyId
| | | N/A | |
| | | countyName
| | | N/A | |
| | | shortAddress
| | | N/A | |
| | | stateName
| | | Orders
> Billing State Province
| |
| | | addressLines
| | | | |
| | | | addressLine1
| | N/A | |
| | | | addressLine2
| | N/A | |
| | | postalCode
| | | Orders
> Billing Postal Code
| |
| | | countryCode
| | | Orders
> Billing Country Code
AND
Orders
> Billing Country Name
| Since we don’t receive the country name in the response, we want to fill the Orders
> Billing Country Name
from the country code. We will receive the ISO2 code of the country, but want to keep store the full country name. |
| | | neighborhoodId
| | | N/A | |
| | | neighborhood
| | | N/A | |
| | | phone
| | | Orders
> Billing Phone
| <v1.1> if the field is empty, we hardcode value ‘+971 (50) 123-45-67’ </v1.1> |
| | | fullAddress
| | | N/A | |
| | | fullName
| | | Orders
> Billing Name
| |
| | customerFirstName
| | | | N/A | |
| | customerEmail
| | | | Orders
> Buyer Mail
| |
| | customerId
| | | | Orders
> Buyer User ID
| |
| | customerLastName
| | | | N/A | |
| | id
| | | | Product In Order Line
> Package ID
| This is a new field!
We need to fill this id across all lines initially. It will be the same id for all of them. |
| | cargoTrackingNumber
| | | | Product In Order Line
> Shipping Tracking Number
| |
| | cargoProviderName
| | | | N/A | |
| | lines
| | | | | |
| | | quantity
| | | Product In Order
> Quantity
| |
| | | salesCampaignId
| | | N/A | |
| | | productSize
| | | Product In Order
> Item Variations
| We store this with an Item Specific Name
= Size |
| | | merchantSku
| | | Product In Order
> SKU
| |
| | | productName
| | | Product In Order
> Item Title
| |
| | | productCode
| | | Product In Order
> Channel Item ID
| |
| | | merchantId
| | | N/A | |
| | | amount
| | | Product In Order
> Item Price
| |
| | | discount
| | | Product In Order
> Discount Amount
| |
| | | tyDiscount
| | | N/A | |
| | | discountDetails
| | | | |
| | | | lineItemPrice
| | N/A | |
| | | | lineItemDiscount
| | N/A | |
| | | | lineItemTyDiscount
| | N/A | |
| | | currencyCode
| | | N/A | |
| | | productColor
| | | Product In Order
> Item Variations
| We store this with an Item Specific Name
= Color |
| | | id
| | | Product In Order
> Order Item Line ID
| |
| | | sku
| | | N/A | |
| | | vatBaseAmount
| | | Product In Order
> VAT Percent
| |
| | | barcode
| | | Product In Order
> EAN
| |
| | | orderLineItemStatusName
| | | Product In Order Line
> Marketplace Status
| |
| | | price
| | | N/A | |
| | | fastDeliveryOptions
| | | N/A | |
| | orderDate
| | | | Orders
> Order Created Time
| |
| | tcIdentityNumber
| | | | N/A | |
| | currencyCode
| | | | Orders
> Order Currency
| |
| | packageHistories
| | | | | It will be good to keep track of this as it basically tells us when the status of the package(s) was changed and to what status it was changed. If we decide, we may not add this.We want to have a field called “Package History” in Orders Trendyol
where we can store multiple records in a two field style. Much like our Item Specifics field. In one field we keep the status, in the other we keep the date. Except that we don’t want to add records manually. |
| | | createdDate
| | | Orders Trendyol
> Created Date
| This is the field name for the table field Package History |
| | | status
| | | Orders Trendyol
> Status
| This is the field name for the table field Package History |
| | shipmentPackageStatus
| | | | N/A | |
| | status
| | | | Orders
> Marketplace Status
| Status mapping provided below also for our internal status. |
| | deliveryType
| | | | N/A | |
| | timeSlotId
| | | | N/A | |
| | estimatedDeliveryStartDate
| | | | N/A | |
| | estimatedDeliveryEndDate
| | | | N/A | |
| | totalPrice
| | | | Orders
> Order Total Amount
| |
| | deliveryAddressType
| | | | N/A | |
| | agreedDeliveryDate
| | | | Orders
> Deliver By Date
| |
| | fastDelivery
| | | | Orders
> Shipping Get It Fast
| |
| | originShipmentDate
| | | | N/A | |
| | lastModifiedDate
| | | | N/A | |
| | commercial
| | | | N/A | |
| | fastDeliveryType
| | | | N/A | |
| | deliveredByService
| | | | N/A | |
| | agreedDeliveryDateExtendible
| | | | N/A | |
| | extendedAgreedDeliveryDate
| | | | N/A | |
| | agreedDeliveryExtensionEndDate
| | | | N/A | |
| | agreedDeliveryExtensionStartDate
| | | | N/A | |
| | warehouseId
| | | | N/A | |
| | groupDeal
| | | | N/A | |
| | micro
| | | | N/A | |
| | giftBoxRequested
| | | | N/A | |
| | 3pByTrendyol
| | | | N/A | |
| | containsDangerousProduct
| | | | N/A | |
Available Statuses on the Marketplace and their relevant mapping in our system as follows:
Service | Definition | MC Pro Status | Notes |
---|---|---|---|
Awaiting | It returns when the payment is waiting the confirm. We should not take any action until these orders with this status change to "Created" status. | Pending | These orders will be lacking other information as well. Most of their data fields (address etc) will be masked with * . We should still download them to be able to properly calculate availability across multiple channels |
Created | When the payment confirm accepted it returns when the order is ready for shipment. | Awaiting Acknowledge | The order has cleared payment and is ready to be fulfilled |
Picking | It is a status that can be communicated by you. You can forward it when you start collecting the order or when you start preparing the package. | Ready for Shipping | We should not be using this status but in case we see it it is still ready for fulfilment order for us |
Invoiced | This is the status that you can forward to us when you make out an invoice. | Ready for Shipping | We should not be using this status but in case we see it it is still ready for fulfilment order for us |
Shipped | Orders that move into transport status are specified in this status. | Dispatched | |
Cancelled | Orders that cancelled. | Cancelled | |
UnPacked | Orders that splitted. | N/A | We dont touch the internal status when we see this. We leave the order at whatever status it is currently. |
Delivered | Orders that delivered. | Dispatched | |
UnDelivered | It returns when the order cannot be delivered to the customer. | Dispatched | We don’t have a value that refers to post Dispatch process regarding the delivery itself. For us this order is still just Dispatched |
UnDeliveredAndReturned | It returns that the order that does not delivered the customer is returned to the supplier. | Dispatched | We don’t have a value that refers to post Dispatch process regarding the delivery itself. For us this order is still just Dispatched |
Besides the mapped fields we should also create a payment record on Status
= Completed, with type
= Payment, Transaction ID
the same as the Order ID, date as the time the order moved to a “Created” status (from the pachageHistories
object, and Total Amount
equal to the order total amount.