```
```

3. Get Shipment Packages With Cursor (getShipmentPackagesStream)

getShipmentPackagesStream

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

You need to send "storeFrontCode" as Header Parameter.

🚧

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) ❗ 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.

Service Parameters

ParameterParameter ValueDefinitionType
supplierIdID information of the relevant supplier should be sentlong
packageItemStatusesCreated, Picking, Invoiced, Shipped ,Cancelled, Delivered, UnDelivered, Returned, AtCollectionPoint, UnPacked, UnSuppliedFetchs the information according to the status of orders.string
lastModifiedStartDateFetches orders whose last update date is after a specific date. Must be sent as a timestamp (in milliseconds) and in GMT+3.long
lastModifiedEndDateFetches orders whose last update date is until the specified date. Must be sent as a timestamp (in milliseconds) and in GMT+3.long
sizeIf not provided, the default value is 50; the maximum allowed value is 200.Specifies the maximum number to list on a page.int
nextCursorOn the first request, nextCursor is not sent
If hasMore = true in the response, continue
The nextCursor value is retrieved and used in the next request
When hasMore = false, the stream is complete
string

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": "John",
                "lastName": "Doe",
                "company": "",
                "address1": "John Doe's House",
                "address2": "John Doe's House",
                "city": "İstanbul",
                "cityCode": 34,
                "district": "Sarıyer",
                "districtId": 54,
                "countyId": 0,
                "countyName": "",
                "shortAddress": "",
                "stateName": "",
                "addressLines": {
                    "addressLine1": "John Doe's House",
                    "addressLine2": "John Doe's House"
                },
                "postalCode": "34200",
                "countryCode": "TR",
                "neighborhoodId": 21111,
                "neighborhood": "Maslak Mahallesi",
                "phone": "333333333",
                "fullAddress": "John Doe's House",
                "fullName": "John Doe"
            },
            "orderNumber": "10654411111",
            "orderCountryCode": "RO", // the country where the customer is located, the country where the order was placed
            "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": "John",
                "lastName": "Doe",
                "company": "",
                "address1": "John Doe's House",
                "address2": "John Doe's House",
                "city": "İstanbul",
                "cityCode": 0,
                "district": "Sarıyer",
                "districtId": 54,
                "countyId": 0,
                "countyName": "",
                "shortAddress": "",
                "stateName": "",
                "addressLines": {
                    "addressLine1": "John Doe's House",
                    "addressLine2": "John Doe's House"
                },
                "postalCode": "",
                "sector": "",
                "countryCode": "TR",
                "neighborhoodId": 0,
                "phone": "333333333",
                "latitude": "11.111111",
                "longitude": "22.222222",
                "fullAddress": "John Doe's House",
                "fullName": "John Doe",
                "taxOffice": "Company of OMS's Tax Office",
                "taxNumber": "Company of OMS's Tax Number"
            },
            "customerFirstName": "John",
            "customerEmail": "[email protected]",
            "customerId": 888888888,
            "supplierId": 99999999,
            "customerLastName": "Doe",
            "channelId": 1, 
            "shipmentPackageId": 3330111111,
            "cargoTrackingNumber": 7280027504111111,
            "cargoTrackingLink": "https://tracking.trendyol.com/?id=111111111-1111-1111-1111-11111111",
            "cargoSenderNumber": "210090111111",
            "sellerDeliveryMethod": "LOCKER", // In case it is LOCKER, package needs to be dropped to the BoxNow locker.Otherwise returns null
            "sellerOtpCode": "2342345",// In case sellerDeliveryMethod is LOCKER, this field returns PIN code to open BoxNow compartement .Otherwise returns null
            "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,
                    "lineSgrFee": 30.40, // average of line sgr fee (lineItemSgrFee/quantity) 
                    "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": [],//fastDeliveryOptions field returns SameDayShipping, FastDelivery or null based on the delivery option defined for that specific product.
                    "productCategoryId": 2710,
                    "commission": 13,
                    "businessUnit": "Sports Shoes",
                    "cancelledBy": "",
                    "cancelReason": "",
                    "cancelReasonCode": 0,
                    "defectiveClaimListingInsight": ""
                }
            ],
            "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, // (as is calculated packageTotalPrice + totalSgrFee) 
            "deliveryAddressType": "Shipment",
            "agreedDeliveryDate": 1762376340000,
            "fastDelivery": false,
            "originShipmentDate": 1762242537619,
            "lastModifiedDate": 1762865408581,
            "commercial": false,
            "fastDeliveryType": "",//fastDeliveryType field returns SameDayShipping, FastDelivery, or null. If a package contains products with different fast delivery types, the highest priority applies (SameDayShipping > FastDelivery > null).
            "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,
            "totalSgrFee": 60.80 //  (total sgrFee of all lines * total of quantities)
        }
    ]
}

Response Field Descriptions

FieldDescription
hasMoreIndicates whether there are more records to fetch
nextCursorOpaque cursor value to use in the next request
sizeNumber of data returned
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

Box Now Order Flow

In case an order package to be dropped to BoxNow locker instead of cargo provider picking, below 2 fields in the response body to be used to progress:

  • “sellerDeliveryMethod”: “LOCKER”

    In case it is LOCKER, package needs to be dropped to the BoxNow locker.Otherwise returns WAREHOUSE or null.

  • “sellerOtpCode”: “2342345"

    In case sellerDeliveryMethod is LOCKER, this field returns PIN code to open BoxNow compartment. In some cases this field cannot be fulfilled once the order created, if "sellerDeliveryMethod” field is “LOCKER” then you need to refetch order package until get this value. If "sellerDeliveryMethod” field is not “LOCKER” than this field returns null.

You can check Box Now locker address via below website in order to decide which locker point you will be dropped the package:

Then you can follow below steps:

Step 1: Print your shipping label.
Step 2: Drop off the package at any BoxNow locker you have chosen for
Step 3: Use the PIN code (sellerOtpCode) to open a compartment.
Step 4: Place the package inside and close the locker door.

Each package must be placed in a separate locker compartment. Multiple packages in the same compartment may result in lost packages or unprocessed returns.


Did this page help you?