TRENDYOL PARTNER (MARKETPLACE) API REFERANS DÖKÜMANI v.1.1 24.08.2017 Trendyol Partner Programı 2017
İÇİNDEKİLER TRENDYOL PARTNER (MARKETPLACE) API REFERANS DÖKÜMANI 1 GİRİŞ 3 API GÜVENLİĞİ 3 TEST ORTAMI BİLGİLERİ 3 CANLI ORTAM BİLGİLERİ 3 METHODLAR 4 ÜRÜN AKTARMA 4 AKTARILMIŞ ÜRÜN BİLGİSİ GÜNCELLEME 7 ONAYLANAN ÜRÜNLERİN ALINMASI 7 ÜRÜN STOK VE FİYAT BİLGİSİ GÜNCELLEME 9 SİPARİŞ PAKETLERİNİN ALINMASI 10 FATURA KESME BİLDİRİMİ 16 TEDARİK EDEMEME BİLDİRİMİ 17 2
GİRİŞ Trendyol Partner API yardımı ile kurumsal firmalar ya da entegratör firmalar Ürün Gönderimi, Ürün Stok ve Fiyat Güncelleme işlemleri, Sipariş Bilgilerinin alınması işlemlerinin sistemsel olarak yapılmasına olanak sağlar. API GÜVENLİĞİ DİKKAT: Bu döküman Trendyol sisteminin canlı ortama geçişi öncesi API hakkında detay vermek için hazırlanmış olup, entegrasyonu yapacak firmalar tarafından dökümana bağlı yapılan geliştirmelere sonrasında API Auth için tekrar geliştirme yapılması gerekecektir. Güvenlik için gerekli bilgiler sonraki versiyonlarda ele alınacaktır. TEST ORTAMI BİLGİLERİ Test ortamına erişebilmek için uygulama sunucularının IP bilgileri Trendyol tarafına bildirilerek erişim tanımı yapılmalıdır. Erişim tanımı sonrasında kullanılacak Supplier ID (Tedarikçi ID) bilgisi Trendyol tarafından sağlanacaktır. Bundan sonraki aşamalarda SupplierID olarak bu ID değeri kullanılacaktır. Tanımlama işlemi için erhan.harmankaya@trendyol.com adresine eposta gönderiniz. http://mp-sandbox.trendyol.com/supplier-api-gateway/swagger-ui.html adresi üzerinden Swagger yardımıyla örnek istekte bulunulabilecektir. CANLI ORTAM BİLGİLERİ Canlı ortam için gerekli bilgiler sonraki versiyonlarda ele alınacaktır. 3
METHODLAR ÜRÜN AKTARMA Ürünler Trendyol sistemine ilk olarak bu method yardımıyla iletilecektir. Tekli ve çoklu ürün gönderimini desteklemektedir. POST createproducts (Tekli Örnek) http://envurl/supplier-api-gateway/suppliers/supplierid/products Content-Type application/json İSTEK "items": [ "attributes": [ "attributename": "Yas Gurubu", "attributevalue": "16-26" "attributename": "Malzeme", "attributevalue": "Kauçuk" "attributename": "Theme", "attributevalue": "İlk Bahar Teması" "barcode":"1122338588995", "brand":"nike", "cargocompany":"yk", "categoryname":"ayakkabı", "currencytype":"try", "description":"trendyolmilla Ayakkabı", "gender":"m", "images":[ "url":"https://pbs.twimg.com/profile_images/594056912615841793/rnhn1wcs.jpg" "listprice":120, "productmainid":"159357", "quantity":5, "saleprice":100, "stockcode":"a11b2c3d4", "title":"trendyolmilla Siyah Ayakkabi", "variantattributes":[ 4
"attributename":"beden", "attributevalue":"m" "attributename":"renk", "attributevalue":"kırmızı" "vatrate":18 "supplierid": 1000 POST createproducts (Tek Ürün 2 Variant Örnek) http://envurl/supplier-api-gateway/suppliers/supplierid/products Content-Type application/json İSTEK "items": [ "attributes": [ "attributename": "Yas Gurubu", "attributevalue": "16-26" "attributename": "Malzeme", "attributevalue": "Kauçuk" "attributename": "Theme", "attributevalue": "İlk Bahar Teması" "barcode":"1122338588994", "brand":"nike", "cargocompany":"yk", "categoryname":"ayakkabı", "currencytype":"try", "color":"kırmızı", "description":"trendyolmilla Ayakkabı", "gender":"m", "images":[ "url":"https://pbs.twimg.com/profile_images/594056912615841793/rnhn1wcs.jpg" "listprice":120, "productmainid":"159357", "quantity":5, "saleprice":100, "stockcode":"a11b2c3d3", "title":"trendyolmilla Siyah Ayakkabi", 5
"variantattributes":[ "attributename":"beden", "attributevalue":"m" "attributename":"renk", "attributevalue":"kırmızı" "vatrate":18 "attributes": [ "attributename": "Yas Gurubu", "attributevalue": "16-26" "attributename": "Malzeme", "attributevalue": "Kauçuk" "attributename": "Theme", "attributevalue": "İlk Bahar Teması" "barcode":"1122338588995", "brand":"nike", "cargocompany":"yk", "categoryname":"ayakkabı", "currencytype":"mavi", "color":"kırmızı", "description":"trendyolmilla Ayakkabı", "gender":"m", "images":[ "url":"https://pbs.twimg.com/profile_images/594056912615841793/rnhn1wcs.jpg" "listprice":120, "productmainid":"159357", "quantity":5, "saleprice":100, "stockcode":"a11b2c3d4", "title":"trendyolmilla Siyah Ayakkabi", "variantattributes":[ "attributename":"beden", "attributevalue":"m" "attributename":"renk", "attributevalue":"mavi" "vatrate":18 "supplierid": 1000 Parametre Açıklamaları 6
Parameters product.brand product.barcode product.title product.description product.category.name product.listprice product.saleprice product.currencytype product.images. [List] product.color product.vatrate product.shipmentfirm product.quantity product.productmainid product.attributes.designer product.attributes.modelsize product.attributes.project product.attributes.theme product.attributes.trendlevel product.gender product.variantattributes.beden product.variantattributes.renk Description Ürün markası Ürün Barkodu Ürün başlığı Ürün açıklama bilgileri (HTML olabilir) Ürün kategori adı Ürün liste fiyatı(satış fiyatı düşük olunca üstü çizilen fiyat) PSF Ürün satış fiyatı TSF Ürün liste fiyatı para birimi (TRY olacaktır.) Ürün resmi URL adresi Listesi/adresleri Ürün rengi (opsiyonel bu alan sonraki versiyonda kaldırılacak) Ürün KDV oranı 0,1,8,18 gibi olmalı Ürün gönderileceği kargo firması Stok miktarı Ana Ürün Kodu Tasarımcı Manken Ölçüsü Proje Tema Trend Seviye Cinsiyet Ürün beden bilgileri, L,XL,M, W32/L23 etc. Ürün rengi gönderilecektir. AKTARILMIŞ ÜRÜN BİLGİSİ GÜNCELLEME Create Products methodu upsert olarak çalışmakta ve eğer ürün yok ise system içinde yaratmak, eğer ilgili barkod için daha önceden gönderim yapıldıysa o barkod ile gelen ikinci istek sonrası gelen bilgilere göre diğer değerler güncellenmektedir. ONAYLANAN ÜRÜNLERİN ALINMASI Trendyol a aktarılan ürünler, Trendyol tarafından yayına alınmadan önce kontrol edilerek onaylanır. Onaylanmış ürünler artık real-time stok ve fiyat güncellemelerini alabilecek statüdedir. 7
GET filterproducts http://envurl//supplier-api-gateway/suppliers/supplierid/products?approved=true DÖNÜŞ "totalelements": 5, "totalpages": 3, "page": 0, "size": 2, "content": [ "id": "00042e917d80bacda81f7637e02365c8", "batchrequestid": "6cdcf370-7285-471f-8e45-92fdf0af924c", "supplierid": 1024, "createdatetime": 1501841091699, "lastupdatedate": 1501843028469, "lastpricechangedate": 1501843028480, "laststockchangedate": 1501841147936, "gender": "", "brand": "TRENDYOLMILLA", "barcode": "86807902889051", "title": "7983 Önü İşlemeli Boyfriend Pantolon-Mavi", "categoryname": "KOLEKSİYON > ALT GİYİM > PANTOLON", "description": "", "color": "Mavi", "stockunittype": "Adet", "quantity": 2, "listprice": 30, "saleprice": 100, "vatrate": 8, "images": [ "url": "http://www.trendyol.com/productimages/98393/big/101a07983_mavi.jpg" "url": "http://www.trendyol.com/productimages/98393/big/101a07983_mavi-1.jpg" "url": "http://www.trendyol.com/productimages/98393/big/101a07983_mavi-2.jpg" "url": "http://www.trendyol.com/productimages/98393/big/101a07983_mavi-3.jpg" "attributes": [ "variantattributes": [ "attributename": "Renk", "attributevalue": "Mavi" "attributename": "Beden", "attributevalue": "36" ] "id": "4b5caac9a72f15677da077373d0ee393", "batchrequestid": "f0046af1-278f-4a2c-b6ef-ea2a9c4cdd31", "supplierid": 1024, 8
] "createdatetime": 1501841204161, "lastupdatedate": 1501846443603, "lastpricechangedate": 1501846443609, "laststockchangedate": 1501846265185, "gender": "", "brand": "TRENDYOLMILLA", "barcode": "8680790286222", "title": "2089 Arkası Fermuarlı Kazak-Ekru", "categoryname": "KOLEKSİYON > ÜST GİYİM > TRİKO", "description": "", "color": "Ekru", "stockunittype": "Adet", "quantity": 20, "listprice": 100, "saleprice": 50, "vatrate": 8, "images": [ "url": "http://www.trendyol.com/productimages/107621/big/101a02089_ekru.jpg" "url": "http://www.trendyol.com/productimages/107621/big/101a02089_ekru-1.jpg" "url": "http://www.trendyol.com/productimages/107621/big/101a02089_ekru-2.jpg" "url": "http://www.trendyol.com/productimages/107621/big/101a02089_ekru-3.jpg" "attributes": [ "variantattributes": [ "attributename": "Renk", "attributevalue": "Ekru" "attributename": "Beden", "attributevalue": "STD" ] ÜRÜN STOK VE FİYAT BİLGİSİ GÜNCELLEME Trendyol a aktarılan ve onaylanan ürünlerin fiyat ve stok bilgileri eş zamanlı olarak güncellenebilmektedir. POST updatepriceandinventory http://envurl/supplier-api-gateway/suppliers/supplierid/products/price-and-inventory Content-Type application/json 9
İSTEK "items": [ "barcode": "BARKODSTRING", "quantity": 12, "saleprice": 69.90 ] DÖNÜŞ HTTP 200 " "batchrequestid": "1541ee80-93ee-40b9-b8e5-b827458968cd" SİPARİŞ PAKETLERİNİN ALINMASI GET orders http://envurl/supplier-api-gateway/suppliers/supplierid/orders DÖNÜŞ "size": 50, "totalpages": 1, "page": 0, "content": [ "shipmentaddress": "id": 4, "firstname": "Buçan", "lastname": "Arıcan", "company": "Beşok, Öztonga and Yıldızoğlu", "address1": "8655 Bulut Groves Apt. 517", "address2": "Apt. 361", "city": "West Beğboğa", "district": "4679 Günçiçek Courts", "postalcode": "29693", "countrycode": "TR", "fulladdress": "8655 Bulut Groves Apt. 517 Apt. 361" "ordernumber": "1155667", "totalprice": 501.00, "taxnumber": "23", "invoiceaddress": "id": 1, "firstname": "Bekbekeç", 10
"lastname": "Yorulmaz", "company": "Ertürk and Sons", "address1": "4422 Akşit Union Apt. 872", "address2": "Apt. 088", "city": "New Baybüre", "district": "8483 Köylüoğlu Point", "postalcode": "12707", "countrycode": "TR", "fulladdress": "4422 Akşit Union Apt. 872 Apt. 088" "customerfirstname": "Algu", "customerid": 115078, "customerlastname": "Akgül", "id": 2, "cargotrackingnumber": null, "lines": [ "quantity": 2, "productid": 37311, "salescampaignid": 15, "productsize": "M", "merchantsku": "185352", "productname": "Awesome Concrete Tuna", "productcode": 121635, "price": 931.0, "productcolor": "#7a184e", "id": 1, "sku": "182163", "vatbaseamount": 14.0, "barcode": "5502805140", "orderlineitemstatusname": "Cancelled" "quantity": 1, "productid": 168855, "salescampaignid": 15, "productsize": "M", "merchantsku": "6984", "productname": "Rustic Rubber Bacon", "productcode": 36407, "price": 3.0, "productcolor": "#630c21", "id": 2, "sku": "98273", "vatbaseamount": 15.0, "barcode": "7638228450", "orderlineitemstatusname": "Cancelled" "quantity": 3, "productid": 30764, "salescampaignid": 15, "productsize": "M", "merchantsku": "110008", "productname": "Unbranded Concrete Pants", "productcode": 94022, "price": 167.0, "productcolor": "#7d4f4a", "id": 3, "sku": "119189", "vatbaseamount": 17.0, "barcode": "3604506472", "orderlineitemstatusname": "Invoiced" "orderdate": 1502262967385, "tcidentitynumber": "20077949804", "currencycode": "TRY" 11
"shipmentaddress": "id": 4, "firstname": "Buçan", "lastname": "Arıcan", "company": "Beşok, Öztonga and Yıldızoğlu", "address1": "8655 Bulut Groves Apt. 517", "address2": "Apt. 361", "city": "West Beğboğa", "district": "4679 Günçiçek Courts", "postalcode": "29693", "countrycode": "TR", "fulladdress": "8655 Bulut Groves Apt. 517 Apt. 361" "ordernumber": "1155667", "totalprice": 501.00, "taxnumber": "23", "invoiceaddress": "id": 1, "firstname": "Bekbekeç", "lastname": "Yorulmaz", "company": "Ertürk and Sons", "address1": "4422 Akşit Union Apt. 872", "address2": "Apt. 088", "city": "New Baybüre", "district": "8483 Köylüoğlu Point", "postalcode": "12707", "countrycode": "TR", "fulladdress": "4422 Akşit Union Apt. 872 Apt. 088" "customerfirstname": "Algu", "customerid": 115078, "customerlastname": "Akgül", "id": 3, "cargotrackingnumber": null, "lines": [ "quantity": 3, "productid": 30764, "salescampaignid": 15, "productsize": "M", "merchantsku": "110008", "productname": "Unbranded Concrete Pants", "productcode": 94022, "price": 167.0, "productcolor": "#7d4f4a", "id": 3, "sku": "119189", "vatbaseamount": 17.0, "barcode": "3604506472", "orderlineitemstatusname": "Invoiced" "orderdate": 1502262967385, "tcidentitynumber": "20077949804", "currencycode": "TRY" "shipmentaddress": "id": 54, "firstname": "Bayunçur", "lastname": "Nebioğlu", "company": "Akbulut and Sons", "address1": "30267 Buyançuk Drives Apt. 309", "address2": "Apt. 616", "city": "New Baçaraberg", "district": "string", "postalcode": "35309", "countrycode": "AG", 12
"fulladdress": "30267 Buyançuk Drives Apt. 309 Apt. 616" "ordernumber": "93719371", "totalprice": 0.00, "taxnumber": "29", "invoiceaddress": "id": 52, "firstname": "Güler", "lastname": "Tekelioğlu", "company": "Akman - Limoncuoğlu", "address1": "234 Arnaç View Apt. 224", "address2": "Suite 479", "city": "East Güvercinburgh", "district": "string", "postalcode": "10004", "countrycode": "QA", "fulladdress": "234 Arnaç View Apt. 224 Suite 479" "customerfirstname": "Andarıman", "customerid": 89494, "customerlastname": "Baykam", "id": 4, "cargotrackingnumber": null, "lines": [ "quantity": 8, "productid": 91262, "salescampaignid": 299, "productsize": null, "merchantsku": "186665", "productname": "Handmade Steel Pants", "productcode": 120368, "price": 731.0, "productcolor": null, "id": 52, "sku": "151104", "vatbaseamount": 16.0, "barcode": "123123", "orderlineitemstatusname": "Cancelled" "quantity": 8, "productid": 85540, "salescampaignid": 299, "productsize": null, "merchantsku": "109890", "productname": "Generic Frozen Pizza", "productcode": 108003, "price": 958.0, "productcolor": null, "id": 53, "sku": "186942", "vatbaseamount": 12.0, "barcode": "456789", "orderlineitemstatusname": "Cancelled" "orderdate": 1502366528725, "tcidentitynumber": "88212762041", "currencycode": "TRY" "shipmentaddress": "id": 57, "firstname": "Bayunçur", "lastname": "Nebioğlu", "company": "Akbulut and Sons", "address1": "30267 Buyançuk Drives Apt. 309", "address2": "Apt. 616", 13
"city": "New Baçaraberg", "district": "string", "postalcode": "35309", "countrycode": "AG", "fulladdress": "30267 Buyançuk Drives Apt. 309 Apt. 616" "ordernumber": "937188371", "totalprice": 13512.00, "taxnumber": "29", "invoiceaddress": "id": 55, "firstname": "Güler", "lastname": "Tekelioğlu", "company": "Akman - Limoncuoğlu", "address1": "234 Arnaç View Apt. 224", "address2": "Suite 479", "city": "East Güvercinburgh", "district": "string", "postalcode": "10004", "countrycode": "QA", "fulladdress": "234 Arnaç View Apt. 224 Suite 479" "customerfirstname": "Andarıman", "customerid": 89494, "customerlastname": "Baykam", "id": 5, "cargotrackingnumber": 1000001153261, "lines": [ "quantity": 8, "productid": 91262, "salescampaignid": 299, "productsize": null, "merchantsku": "186665", "productname": "Handmade Steel Pants", "productcode": 120368, "price": 731.0, "productcolor": null, "id": 54, "sku": "151104", "vatbaseamount": 16.0, "barcode": "123123", "orderlineitemstatusname": "ReadyToShip" "quantity": 8, "productid": 85540, "salescampaignid": 299, "productsize": null, "merchantsku": "109890", "productname": "Generic Frozen Pizza", "productcode": 108003, "price": 958.0, "productcolor": null, "id": 55, "sku": "186942", "vatbaseamount": 12.0, "barcode": "456789", "orderlineitemstatusname": "ReadyToShip" "orderdate": 1502366539053, "tcidentitynumber": "88212762041", "currencycode": "TRY" "shipmentaddress": "id": 61, "firstname": "Arı", 14
"lastname": "Akal", "company": "Türkdoğan LLC", "address1": "817 Balakatay Motorway Suite 341", "address2": "Apt. 813", "city": "West Alpyörük", "district": "706 Kulaksızoğlu Street", "postalcode": "10736", "countrycode": "TR", "fulladdress": "817 Balakatay Motorway Suite 341 Apt. 813" "ordernumber": "5632131556", "totalprice": 2741.00, "taxnumber": "31", "invoiceaddress": "id": 58, "firstname": "Engin", "lastname": "Kurutluoğlu", "company": "Taşçı and Sons", "address1": "3457 Atsız Row Apt. 269", "address2": "Apt. 628", "city": "South Çağrıteginfort", "district": "8868 Beğdurmuş Knolls", "postalcode": "18465", "countrycode": "TR", "fulladdress": "3457 Atsız Row Apt. 269 Apt. 628" "customerfirstname": "Ayma", "customerid": 59488, "customerlastname": "Durak ", "id": 6, "cargotrackingnumber": 1000001153292, "lines": [ "quantity": 2, "productid": 55829, "salescampaignid": 15, "productsize": "M", "merchantsku": "117415", "productname": "Handmade Plastic Bacon", "productcode": 59528, "price": 980.0, "productcolor": "#387352", "id": 56, "sku": "194897", "vatbaseamount": 8.0, "barcode": "19380946248", "orderlineitemstatusname": "ReadyToShip" "quantity": 1, "productid": 96622, "salescampaignid": 15, "productsize": "M", "merchantsku": "181862", "productname": "Intelligent Frozen Table", "productcode": 17583, "price": 289.0, "productcolor": "#0c0d76", "id": 57, "sku": "47178", "vatbaseamount": 14.0, "barcode": "11940273720", "orderlineitemstatusname": "ReadyToShip" "quantity": 3, "productid": 165706, "salescampaignid": 15, 15
"productsize": "M", "merchantsku": "11994", "productname": "Incredible Rubber Computer", "productcode": 71928, "price": 164.0, "productcolor": "#385867", "id": 58, "sku": "136674", "vatbaseamount": 10.0, "barcode": "5377644000", "orderlineitemstatusname": "ReadyToShip" "orderdate": 1502367147140, "tcidentitynumber": "76781559963", "currencycode": "TRY" "totalelements": 5 FATURA KESME BİLDİRİMİ Oluşturularan sipariş paketinin faturasının kesilmesi işleminin Trendyol a bildirilebilmesi için kullanılır. Fatura kesme işleminin bildirilmesi, Trendyol Müşteri Hizmetlerine ulaşan, müşteri kaynaklı iptallerin önlenmesi için bir referanstır. PUT updatepackage http://envurlsupplier-api-gateway/suppliers/supplierid/shipment-packages/shipmentpackageid Content-Type application/json İSTEK "lines": [ "lineid": 0, "quantity": 0 "params": "invoicenumber" :"FTRNUMBER53253434" "status": "Invoiced" DÖNÜŞ HTTP 200 NO CONTENT 16
TEDARİK EDEMEME BİLDİRİMİ Tedarikçinin paket içerisindeki ürünlerden bir ya da birkaçını Tedarik Edememe kaynaklı iptal etmesi için kullanılır. Bu method yardımıyla yapılan bir iptal sonrası, iptal edilen paket bozularak yeni ID li bir paket oluşturulacaktır. PUT updatepackage http://mp-sandbox.trendyol.com/supplier-api-gateway Content-Type application/json İSTEK "lines": [ "lineid": 1, "quantity": 1 "params": "status": "Unsupplied" DÖNÜŞ HTTP 200 NO CONTENT 17