Marketplaces / Trendyol / Trendyol Product Management / Trendyol Update Stock

Trendyol Update Stock

Version Date Created / Updated Notes
v1.0 Hristiyan Georgiev

We use the same call as the price updates which means that we send an update, then in the response we get a request ID which we then need to call in order to find out if our update was successful or not. For this we want to use our feeds functionality

API Call : POST /integration/inventory/sellers/{supplierId}/products/price-and-inventory API Docs : https://developers.trendyol.com/int/docs/international-marketplace/international-product-v2/int-stock-and-price-update

Please note that we can include up to 1000 products in a single request. So we need to have logic and split into two or more calls if we have more than 1k SKUs.

The supplierId we should pick from Channel Trendyol > Supplier ID

All triggers, validations, etc. are as per our abstraction - Stock Update general requirements

Example Call :

{
  "items": [
    {
      "barcode": "FR22-R2000445-M",      
      "quantity": 20
    },
    {
      "barcode": "FR22-R2000445-L",      
      "quantity": 30
    },
    {
      "barcode": "FR22-R2000445-S",      
      "quantity": 40
    }
  ]
}

Mapping :

Trendyol Field MC Pro Field Notes
items
barcode Product > SKU
quantity Listing > Quantity

Example response :

{
    "batchRequestId": "9cf63d90-9e7c-471c-b26b-36a35f08f243-1743252092"
}

After each successfully stock update send, we will receive the batch request id from the response and need to store it in Marketplace Feeds table with a Processing status, with the following info in the feed :

Trendyol Field Mc Pro Field Notes
batchRequestId Marketplace Feed > External ID
Marketplace Feed > Account For which account is the feed generated.
Marketplace Feed > Type Hardcoded as “Listing Stock Update“
Marketplace Feed > Submitted Date When the feed is submitted
Marketplace Feed > Sent Objects Count How many SKUs we have pushed in the feed

After we have pushed the stock update and created the feed, we want to keep the Listings > Update Quantity on Sent until we read the feed response, which is done through the following call

API Call : GET /integration/product/sellers/{supplierId}/products/batch-requests/{batchRequestId}

API Docs : https://developers.trendyol.com/int/docs/international-marketplace/international-product-v2/int-check-batch-request-result

The supplierId we should pick from Channel Trendyol > Supplier ID

The batchRequestId we pick from Marketplace Feed > External ID .

Example Response :

{
    "batchRequestId": "9cf63d90-9e7c-471c-b26b-36a35f08f243-1743252092",
    "items": [
        {
            "requestItem": {
                "priceInventoryUpdateRequest": {
                    "storeFrontCode": "AE",
                    "barcode": "FR22-R2000445-L",
                    "quantity": 30,
                    "originalPrice": null,
                    "salePrice": null,
                    "productMainId": null,
                    "stockCode": null,
                    "ignoreEmptyOriginalPrice": true
                },
                "barcode": "FR22-R2000445-L"
            },
            "status": "SUCCESS",
            "failureReasons": []
        },
        {
            "requestItem": {
                "priceInventoryUpdateRequest": {
                    "storeFrontCode": "AE",
                    "barcode": "FR22-R2000445-S",
                    "quantity": 40,
                    "originalPrice": null,
                    "salePrice": null,
                    "productMainId": null,
                    "stockCode": null,
                    "ignoreEmptyOriginalPrice": true
                },
                "barcode": "FR22-R2000445-S"
            },
            "status": "SUCCESS",
            "failureReasons": []
        },
        {
            "requestItem": {
                "priceInventoryUpdateRequest": {
                    "storeFrontCode": "AE",
                    "barcode": "FR22-R2000445-M",
                    "quantity": 20,
                    "originalPrice": null,
                    "salePrice": null,
                    "productMainId": null,
                    "stockCode": null,
                    "ignoreEmptyOriginalPrice": true
                },
                "barcode": "FR22-R2000445-M"
            },
            "status": "SUCCESS",
            "failureReasons": []
        }
    ],
    "status": "COMPLETED",
    "creationDate": 1743072092194,
    "lastModification": 1743072093556,
    "sourceType": "API",
    "itemCount": 3,
    "failedItemCount": 0,
    "batchRequestType": "GlobalProductPriceInventoryUpdate",
    "notes": null
}

Mapping :

Trendyol Field Mc Pro Field Notes
batchRequestId N/A
items
requestItem
priceInventoryUpdateRequest
storeFrontCode N/A
barcode N/A
quantity N/A
originalPrice N/A
salePrice N/A
productMainId N/A
stockCode N/A
ignoreEmptyOriginalPrice N/A
barcode Not sure how our feeds response readers work, but we could use this to map with Product > SKU in order to find out which SKU it is.
status If we have status FAILED this means the update for this SKU did not work. When we have this status, we need to set Listings > Update Quantity = Error
If we have status SUCCESS, we set the Listings > Update Quantity = Not Needed
failureReasons Listings > Error Updating Quantity
status Marketplace Feed > External Status When Trendyol is processing the feed, it will have an "IN_PROGRESS" status. During this time, we do not need to take any action with the feed in McPro. Once we receive a "COMPLETED" status, it indicates that Trendyol has successfully finished processing the feed, and that is when we should begin processing the feed and its feed objects internally.
creationDate N/A
lastModification Marketplace Feed > Completed Date We will receive it as unix timestamp, we only need to store the date which in 99.99% of the cases will be the same date as the Submitted date
sourceType N/A
itemCount N/A
failedItemCount N/A
batchRequestType Marketplace Feed > External Type
notes N/A
Is this article helpful?
0 0 0