HomeGuidesAPI ReferenceChangelogSupport Request
Guides

Get Shipment Packages With Cursor (getShipmentPackagesStream)

getShipmentPackagesStream

getShipmentPackagesStream is an endpoint that allows you to fetch order packages in a cursor-based (stream) manner.

🚧

IMPORTANT

The existing getShipmentPackages endpoint is not optimized for scanning large data sets.

For this endpoint:

  • Maximum accessible record count: 10,000
  • High-volume data fetching can cause load on the system
  • Rate limit restrictions can be hit more quickly

Therefore, getShipmentPackagesStream is recommended for the following scenarios:

✔ Large data scanning (full scan) ✔ Periodic synchronization (polling / cron) ✔ Exporting all orders

✅ The response structure is the same; only pagination-related fields will not be returned. (totalElements, totalPages, page, size) ❗ The pagination mechanism has changed (cursor-based)


📦 Data Scope & Date Restrictions

  • Data from the last 3 months is accessible through this endpoint.

❗ The time range is limited to a maximum of 2 weeks (14 days):

  • If lastModifiedStartDate and lastModifiedEndDate are not provided → the system automatically limits to the last 2 weeks.

❗ Response Difference

The response structure of the getShipmentPackagesStream endpoint is the same as the existing endpoint; only the following fields are no longer returned:

  • totalElements
  • totalPages
  • page

Instead, the following fields are used:

  • hasMore
  • nextCursor
  • size

Therefore, integrations using page-based pagination need to migrate to a cursor-based structure.

Migration Note

  • Instead of page++ → use nextCursor
  • Instead of checking totalPages → check hasMore

Stream Service vs. Existing Service

FeatureExisting Service (getShipmentPackages)Stream Service (getShipmentPackagesStream)
Use CaseSmall / instant queriesLarge data scanning & synchronization
PaginationPage-based (page, totalPages)Cursor-based (nextCursor, hasMore)
Maximum Data Access⚠️ Limited to 10,000 records✅ High-limit streaming
Large Data Performance⚠️ Limited✅ Optimized

How Does Cursor-Based Pagination Work?

The cursor mechanism differs from the classic page logic:

  • Instead of page, a stream pointer (cursor) is used
  • Each request continues from where the previous one left off
  • Provides stable and efficient progression for large data sets

Flow

  1. On the first request, nextCursor is not sent
  2. If hasMore = true in the response, continue
  3. The nextCursor value is retrieved and used in the next request
  4. When hasMore = false, the stream is complete

⚠️ Critical Rules

  • nextCursor is an opaque value → it must not be parsed or modified.
  • The filters that were initially set when using the same cursor value must not be changed
  • If the filter changes → a 400 Bad Request is returned
  • Sorting is fixed; results are returned in DESC order by Last Modified Date
  • To work with a new filter → a new stream must be started

Recommended Usage:

  • The recommended usage is to send requests at minimum 5-second intervals.

Endpoint

PROD

GET https://apigw.trendyol.com/integration/order/sellers/{sellerId}/orders/stream

STAGE

GET https://stageapigw.trendyol.com/integration/order/sellers/{sellerId}/orders/stream

Example Service Response

{
    "hasMore": true,
  	"nextCursor": "609ca79b-1fdf-4c4e-a814-498ce9c1c039",
		"size": 50,

    "content": [
        {
            "shipmentAddress": {
                "id": 11111111,
                "firstName": "Trendyol",
                "lastName": "Customer",
                "company": "",
                "address1": "DSM Grup Danışmanlık İletişim ve Satış Ticaret A.Ş. Maslak Mahallesi Saat Sokak Spine Tower No:5 İç Kapı No:19 Sarıyer/İstanbul",
                "address2": "",
                "city": "İstanbul",
                "cityCode": 34,
                "district": "Sarıyer",
                "districtId": 54,
                "countyId": 0,
                "countyName": "",
                "shortAddress": "",
                "stateName": "",
                "addressLines": {
                    "addressLine1": "",
                    "addressLine2": ""
                },
                "postalCode": "34200",
                "countryCode": "TR",
                "neighborhoodId": 21111,
                "neighborhood": "Maslak Mahallesi",
                "phone": null,
                "fullAddress": "DSM Grup Danışmanlık İletişim ve Satış Ticaret A.Ş. Maslak Mahallesi Saat Sokak Spine Tower No:5 İç Kapı No:19 Sarıyer/İstanbul",
                "fullName": "Trendyol Customer"
            },
            "orderNumber": "10654411111",
            "packageGrossAmount": 498.90,
            "packageSellerDiscount": 0.00,
            "packageTyDiscount": 0.00,
            "packageTotalDiscount": 0.00,
            "discountDisplays": [
                {
                    "displayName": "20% Discount in Cart",
                    "discountAmount": 100
                }
            ],
            "taxNumber": null,
            "invoiceAddress": {
                "id": 11111112,
                "firstName": "Trendyol",
                "lastName": "Customer",
                "company": "",
                "address1": "DSM Grup Danışmanlık İletişim ve Satış Ticaret A.Ş. Maslak Mahallesi Saat Sokak Spine Tower No:5 İç Kapı No:19 Sarıyer/İstanbul",
                "address2": "",
                "city": "İstanbul",
                "cityCode": 0,
                "district": "Sarıyer",
                "districtId": 54,
                "countyId": 0,
                "countyName": "",
                "shortAddress": "",
                "stateName": "",
                "addressLines": {
                    "addressLine1": "",
                    "addressLine2": ""
                },
                "postalCode": "",
                "countryCode": "TR",
                "neighborhoodId": 0,
                "phone": null,
                "latitude": "11.111111",
                "longitude": "22.222222",
                "fullAddress": "DSM Grup Danışmanlık İletişim ve Satış Ticaret A.Ş. Maslak Mahallesi Saat Sokak Spine Tower No:5 İç Kapı No:19 Sarıyer/İstanbul",
                "fullName": "Trendyol Customer",
                "taxOffice": "Company of OMS's Tax Office",
                "taxNumber": "Company of OMS's Tax Number"
            },
            "customerFirstName": "Trendyol",
            "customerEmail": "[email protected]",
            "customerId": 1451111111,
            "supplierId": 2738,
            "customerLastName": "Customer",
            "shipmentPackageId": 3330111111,
            "cargoTrackingNumber": 7280027504111111,
            "cargoTrackingLink": "https://tracking.trendyol.com/?id=111111111-1111-1111-1111-11111111",
            "cargoSenderNumber": "210090111111",
            "cargoProviderName": "Trendyol Express",
            "lines": [
                {
                    "quantity": 1,
                    "salesCampaignId": 11,
                    "productSize": "One Size",
                    "stockCode": "111111",
                    "productName": "Bird and Flower Patterned Tray - Green / Gold - 49 cm, 01SYM134, One Size",
                    "contentId": 1239111111,
                    "productOrigin": "TR",
                    "sellerId": 2738,
                    "lineGrossAmount": 498.90,
                    "lineTotalDiscount": 0.00,
                    "lineSellerDiscount": 0.00,
                    "lineTyDiscount": 0.00,
                    "discountDetails": [
                        {
                            "lineItemPrice": 498.90,
                            "lineItemSellerDiscount": 0.00,
                            "lineItemTyDiscount": 0.00
                        }
                    ],
                    "currencyCode": "TRY",
                    "productColor": "Green",
                    "lineId": 4765111111,
                    "vatRate": 20.00,
                    "barcode": "8683772071724",
                    "orderLineItemStatusName": "Delivered",
                    "lineUnitPrice": 498.90,
                    "fastDeliveryOptions": [],
                    "productCategoryId": 2710,
                    "commission": 13,
                    "businessUnit": "Sports Shoes",
                    "cancelledBy": "",
                    "cancelReason": "",
                    "cancelReasonCode": 0
                }
            ],
            "orderDate": 1762253333685,
            "identityNumber": "11111111111",
            "currencyCode": "TRY",
            "packageHistories": [
                {
                    "createdDate": 1762242537624,
                    "status": "Created"
                }
            ],
            "shipmentPackageStatus": "Delivered",
            "status": "Delivered",
            "whoPays": 1,
            "deliveryType": "normal",
            "timeSlotId": 0,
            "estimatedDeliveryStartDate": 1762858136000,
            "estimatedDeliveryEndDate": 1763030936000,
            "packageTotalPrice": 498.90,
            "deliveryAddressType": "Shipment",
            "agreedDeliveryDate": 1762376340000,
            "fastDelivery": false,
            "originShipmentDate": 1762242537619,
            "lastModifiedDate": 1762865408581,
            "commercial": false,
            "fastDeliveryType": "",
            "deliveredByService": false,
            "warehouseId": 372389,
            "invoiceLink": "https://efatura01.evidea.com/11111111111",
            "micro": true,
            "giftBoxRequested": false,
            "3pByTrendyol": false,
            "etgbNo": "25341453EX025864",
            "etgbDate": 1762646400000,
            "containsDangerousProduct": false,
            "cargoDeci": 10,
            "isCod": false,
            "createdBy": "order-creation",
            "originPackageIds": null,
            "hsCode": "711111000000",
            "shipmentNumber": 606404425
        }
    ]
}

Response Field Descriptions

FieldDescription
hasMoreIndicates whether there are more records to fetch
nextCursorOpaque cursor value to use in the next request
sizeNumber of returned data
packageGrossAmountTotal gross amount of the package (without discounts)
packageSellerDiscountSeller discount amount
packageTyDiscountMay be populated when commercial is true, will return 0 when false
packageTotalDiscountTotal discount amount (packageSellerDiscount + packageTyDiscount)
shipmentPackageIdPackage ID
stockCodeSeller stock code
sellerIdSeller ID
lineGrossAmountUnit gross price of the product (without discounts)
lineTotalDiscountUnit total discount (lineSellerDiscount + lineTyDiscount)
lineSellerDiscountUnit seller discount (average of items)
lineTyDiscountUnit Trendyol discount (average of items)
discountDetailsSeparate discount details for each unit (item)
lineItemPriceDiscounted unit price (lineGrossAmount - lineItemSellerDiscount - lineItemTyDiscount)
lineItemSellerDiscountSeller discount applied to this item
lineItemTyDiscountTrendyol discount applied to this item
lineIdOrder line item ID
vatRateVAT rate
commissionCommission rate
cancelledByCancelling party
cancelReasonCancellation reason
cancelReasonCodeCancellation reason code
lineUnitPriceNet unit price (lineGrossAmount - lineSellerDiscount - lineTyDiscount)
packageTotalPriceTotal net price of the package (discounted)
whoPaysReturns 1 if it is a seller agreement; the field is not returned if it is a Trendyol agreement
invoiceAddress.companyMay be empty for GULF region orders
invoiceAddress.districtMay be empty for GULF region orders
invoiceAddress.postalCodeMay be empty for GULF region orders
invoiceAddress.taxOfficeWill not be returned in the body when there is no corporate invoice (if commercial=false)
invoiceAddress.taxNumberWill not be returned in the body when there is no corporate invoice (if commercial=false)
shipmentAddress.countyIdWill be provided for the CEE region
shipmentAddress.countyNameWill be provided for the CEE region
shipmentAddress.shortAddressWill be provided for the GULF region
shipmentAddress.stateNameWill be provided for the GULF region
etgbNoThe etgbNo field will return information when micro is true
etgbDateThe etgbDate field will return information when micro is true
containsDangerousProductIn micro export orders, if there is any dangerous product in the package such as batteries, perfume, etc., it will return true
createdByIndicates how the package was created; can be "order-creation", "split", "cancel", or "transfer"
originPackageIdsThis field is populated after cancel or split operations and provides the packageId of the original package after these operations
hsCodeThis field will be returned as a string for micro orders


Starting from 15th June 2026 below new fields will be added to the response body (this date is draft):

 					  "invoiceNumber": "1255141" 
            "invoiceStatus": "NotInvoiced" 
						"invoiceRejectedReasonKeys: [
								{	
									"INVOICE_NUMBER_ALREADY_EXISTS",
                  "NVOICE_TOTAL_MISMATCH"    
								}
              ]

Definitions of "invoiceStatus" field :

invoiceStatusDefinition
NotInvoicedIndicates that the invoice for the order package has not been sent.
ReceivedThe invoice for the order package is currently under review.
RejectedThe invoice for the order package was found to be incorrect/invalid after controls. For order packages in this status: if it is a Türkiye Marketplace order, the incorrect invoice must be deleted from the order package and resent. If it is a Micro-Export or Trendyol Cross-Border Fulfillment order, a new invoice must be provided without sending a delete request for the same order package.
InvoicedThe invoice for the order package has been verified as correct after controls. The "invoiceLink" field for the order package will be with value only for packages that have transitioned to this status other. For Micro-Export and Trendyol Cross-Border Fulfillment order packages that have not transitioned to this status, cargo labels will not be returned by our integration service.

Definitions of "invoiceRejectedReasonKeys" field:

invoiceRejectedReasonKeysDefinition
INVOICE_LINE_MISMATCHFor each product type in your order, there must be a matching line item containing the correct product quantity, unit price, and VAT information.
INVOICE_TOTAL_MISMATCHThe grand total amount on your invoice must match the total order amount.
INVOICE_LINE_NUMBER_MISMATCHThe number of line items on your invoice must match the number of unique product types in the order.
INVOICE_TYPE_MISMATCHThe invoice type specified on your invoice must be "sales".
SENDER_VKN_MISMATCHThe sender's Tax Identification Number (VKN) on your invoice must match the VKN defined in the system.
RECEIPENT_VKN_MISMATCHThe recipient's Tax Identification Number (VKN) on your invoice must match Trendyol's VKN details.
INVOICE_NUMBER_MISMATCHThe invoice number on your invoice must match the invoice number you provided for the order.
INVOICE_DATE_MISMATCHThe invoice date must be later than or equal to the order date.
INVOICE_SCENARIO_MISMATCHThe invoice scenario must be either "basic" or "commercial".
INVOICE_NOT_FOUND_IN_MAILBOXThe invoice could not be found in the Trendyol mailbox. You are expected to submit a new invoice.
INVOICE_NUMBER_ALREADY_EXISTSA previously submitted invoiceNumber is being resent for a different order package. The invoice number must be changed.