Siparişler
Bu servis aracılığı ile Labs platformu üzerinde yeni sipariş oluşturabilir, oluşturulan siparişlerinizin listesini çekebilir, sipariş bilgilerini güncelleyebilir veya silebilirsiniz.
Yeni Sipariş Oluştur
Yeni sipariş oluşturmak için gerekli parametreler aşağıdaki tabloda belirtilmiştir.
Önemli Bilgi : Yeni sipariş oluşturmak için userId bilgisi kullanılmalıdır.
- Name
id
* zorunlu- Type
- string
- Description
Sipariş ID bilgisidir. Labs API ye ileteceğiniz uniqeu id bilgisidir.
- Name
cargoCompany
- Type
- string
- Description
Kargo kodu bilgisidir. Labs API kabul ettiği kod bilgiliri gönderilmelidir.
Kargo kodları: ARAS, MNG, YK ...
- Name
cargoFee
- Type
- float
- Description
Kargo fiyatı bilgisidir.
- Name
isFreeShipping
- Type
- bollean
- Description
Kargo ücretli mi? true, false
- Name
currency
- Type
- string
- Description
Para birimi. TRY, USD ...
- Name
discountData
- Type
- array
- Description
Sipariş indirim bilgisidir.
- Name
discountData.*.price
- Type
- float
- Description
Siparişe tanımlı indirim ücreti.
- Name
discountData.*.type
- Type
- string
- Description
Siparişe tanımlı indirim tipi. percent, value
- Name
discountData.*.type
- Type
- integer
- Description
Siparişe tanımlı indirim oranı.
- Name
shipmentAddressId
* zorunlu- Type
- string
- Description
Sipariş gönderim adres id bilgisidir.
- Name
invoiceAddressId
* zorunlu- Type
- string
- Description
Sipariş fatura adres id bilgisidir.
- Name
orderNote
- Type
- array
- Description
Sipariş notu.
- Name
paymentId
- Type
- string
- Description
Ödeme id bilgisdir
- Name
paymentStatus
* zorunlu- Type
- string
- Description
Sipariş ödeme durumu bilgisidir. COMPLETED
- Name
priceTotal
* zorunlu- Type
- float
- Description
Sipariş toplam fiyat bilgisidir.
- Name
source
* zorunlu- Type
- string
- Description
Sipariş kaynağı bilgisir. Labs tarafından belirlenen kaynaklara sipariş oluşturulabilir.
- Name
customerId
* zorunlu- Type
- integer
- Description
Müşteri servisinden dönen customerId (id) bilgisidir.
- Name
warehouseId
* zorunlu- Type
- integer
- Description
Depo servisinden dönen warehouseId (id) bilgisidir.
- Name
products
* zorunlu- Type
- array
- Description
Ürün bilgilerini içeren datadır.
- Name
products.id
* zorunlu- Type
- string
- Description
Sipariş ürün kalemi id bilgisidir.
- Name
products.title
* zorunlu- Type
- string
- Description
Sipariş ürün başlık bilgisidir.
- Name
products.barcode
* zorunlu- Type
- string
- Description
Sipariş ürün barkod bilgisidir.
- Name
products.quantity
* zorunlu- Type
- integer
- Description
Sipariş ürün adet bilgisidir.
- Name
products.weight
* zorunlu- Type
- integer
- Description
Sipariş ürün ağırlık bilgisidir.
- Name
products.unitType
* zorunlu- Type
- string
- Description
Sipariş ürün birimi bilgisidir. Adet için 'ADET', Kilogram için 'GRAM' değeri kullanılmalıdır. 'GRAM' için products.weight değeri gram cinsinden hesaplanıp iletilmelidir.
- Name
products.status
* zorunlu- Type
- string
- Description
Sipariş ürün durumu bilgisidir.
- Name
products.price
* zorunlu- Type
- float
- Description
Sipariş ürün fiyat bilgisidir.
Request
curl --location --request POST 'https://api.labsoffice.com/v1/products' \
--header 'Authorization: Bearer {API_TOKEN}'
--header 'Content-Type: application/json' \
--data-raw '{
"id": "1242341",
"cargoCompany": "ARAS",
"cargoFee": 0,
"isFreeShipping" : true,
"currency": "TRY",
"discountData": {
"price": null,
"type": "percent",
"value": 10
},
"shipmentAddressId":"658d4d770aa5ccb4e003ea5b",
"invoiceAddressId": "658d4d770aa5ccb4e003ea5b",
"orderNote": null,
"paymentId": "",
"paymentStatus": "COMPLETED",
"priceTotal": "602.90",
"products": [
{
"id": 13,
"title": "4x4 Alfa AP 40 Arduazlı Membran",
"barcode": "8616161202027",
"quantity": 2,
"weight":null,
"unitType":"ADET",
"status": "COPMLETED",
"price": "199.90",
"vat_rate": 8,
"vat_include": true
}
],
"source": "VAGA",
"customerId": 1943012,
"warehouseId": 184
}'
Response
{
"status": "success",
"message": "Sipariş oluşturma işlemi başarılı.",
"payload": {
"marketplace_id": "1242341",
"source": "VAGA",
"merchant_id": 10100,
"customer_name": "Sercan Yıldız",
"package_id": "LABS820748183840",
"cargo_barcode": "LABS820748183840",
"cargo_company": "ARAS",
"cargo_fee": 0,
"currency": "TRY",
"shipment_address": {
"invoice_type": "personal",
"company_name": "",
"address_name": "Ev",
"customer_name": "Sercan Yıldız",
"tax_office": null,
"country_code": "TR",
"address": "Bulancak merkez girensun",
"tax_number": null,
"phone_number": "05435746878",
"district": "Bulancak",
"city": "Giresun",
"town": "İhsaniye Mh Bahçeli Sk No236 d 131 kat 1",
"identity": "99999999999"
},
"invoice_address": {
"invoice_type": "personal",
"company_name": "",
"address_name": "Ev",
"customer_name": "Sercan Yıldız",
"tax_office": null,
"country_code": "TR",
"address": "Bulancak merkez girensun",
"tax_number": null,
"phone_number": "05435746878",
"district": "Bulancak",
"city": "Giresun",
"town": "İhsaniye Mh Bahçeli Sk No236 d 131 kat 1",
"identity": "99999999999"
},
"order_status": "CREATED",
"payment_source": "VAGA",
"user_id": 1943012,
"user_country_code": "TR",
"user_city": "GIRESUN",
"manager_note": null,
"manager_id": 0,
"warehouse_id": 184,
"updated_at": "2023-12-29 11:47:22",
"created_at": "29/12/2023 11:47:22",
"id": 2752184
}
}
Sipariş Listesi
Bu servis aracılığı ile Labs platformu üzerinde oluşturulan siparişlerinizi listeleyebilirsiniz.
Servis pagination ile çalışmaktadır. page ve limit parametrelerinin gönderilmesi zorunludur. Filtreleme yapabilmek için gerekli parametreler aşağıdaki tabloda belirtilmiştir.
Optional attributes
- Name
page
- Type
- integer
- Description
Mevcut sayfa bilgisi
- Name
limit
- Type
- integer
- Description
Sayfa başına düşen içerik sayısı
- Name
status
- Type
- string
- Description
Sipariş statü bilgisi
PENDING_APPROVED, CREATED, PREPARING, COMPLETED, RETURN
- Name
source
- Type
- string
- Description
Platform bilgisi
TRENDYOL, HEPSIBURADA, GETIR
- Name
cargoCode
- Type
- string
- Description
Kargo firma bilgisi
MNG, ARAS, SURAT, YK, HX
- Name
warehouseId
- Type
- integer
- Description
Depo id bilgisi
- Name
platformId
- Type
- integer
- Description
Platform sipariş id bilgisi
- Name
createdStartAfter
- Type
- string
- Description
Başlangıç tarih bilgisi Örnek format : 2023-11-29
- Name
updatedStartAfter
- Type
- string
- Description
Güncelleme tarih bilgisi Örnek format : 2023-11-29
Request
curl --location --request GET 'https://api.labsoffice.com/v1/orders?page=1&limit=10' \
--header 'Authorization: Bearer {API_TOKEN}'
Response
{
"items": [
{
"id": 2663229,
"packageId": "",
"managerId": null,
"currency": "TRY",
"source": "HEPSIBURADA",
"orderStatus": "PENDING_APPROVE",
"marketplaceId": "65671a96-110c-0c10-3f24-24f406060606",
"managerNote": null,
"createdAt": "30/11/2023 10:48:26",
"isTransfered": 0,
"isCorporate": false,
"shipmentAddress": {
"addressName": "Otomatik Oluşturulan",
"invoiceType": "personal",
"identifier": {
"customerName": "Gülay Türk",
"phoneNumber": "905061579135",
"identity": 11111111111
},
"addressDetail": {
"countryCode": "TR",
"city": "Balıkesir",
"district": "Balya",
"town": "Koca Camii",
"state": "",
"address": "kocacami mah. mercan sk no:14 KOCA CAMİİ BALYA Balıkesir",
"postalCode": ""
},
"isDefault": 1,
"company": {
"companyName": "",
"taxNumber": "",
"taxOffice": ""
}
},
"invoiceAddress": {
"addressName": "Otomatik Oluşturulan",
"invoiceType": "personal",
"identifier": {
"customerName": "Gülay Türk",
"phoneNumber": "905061579135",
"identity": 11111111111
},
"addressDetail": {
"countryCode": "TR",
"city": "Balıkesir",
"district": "Balya",
"town": "Koca Camii",
"state": "",
"address": "kocacami mah. cami sk. no.9 KOCA CAMİİ BALYA Balıkesir",
"postalCode": ""
},
"isDefault": 1,
"company": {
"companyName": "",
"taxNumber": "",
"taxOffice": ""
}
},
"warehouseId": 184,
"totalProductQty": 0,
"customer": {
"custumerName": "Gülay türk",
"custumerEmail": "234456998_7000037723_0@hepsifatura.com",
"custumerPhoneNumber": "905061579135",
"custumerIdentity": "11111111111"
},
"payment": {
"paymentId": null,
"paymentMethod": "MARKETPLACE",
"paymentStatus": "SUCCESS"
},
"shipment": {
"dispatchStatus": false,
"dispatchDescription": "",
"cargoCompany": "HZ",
"barcodeId": "",
"trackingId": null,
"trackingUrl": null,
"shippingFee": 0
},
"provision": {
"maxPossibleAmount": null,
"minPossibleAmount": null,
"maxWeight": null,
"minWeight": null,
"unitId": null
},
"lines": [
{
"id": 12097167,
"barcodeId": "8693461064371E",
"status": "CANCELLED",
"qty": "0.00",
"requestedQty": "1.00",
"cancelledQty": 1,
"price": "2825.0000",
"currency": "TRY",
"modelId": null,
"attributes": [],
"lineDescription": "Pilsan Taş Ev",
"thumbnail": "https://static-labs.s3.eu-central-1.amazonaws.com/products/",
"provision": {
"maxPossibleAmount": null,
"minPossibleAmount": null,
"maxWeight": null,
"minWeight": null,
"unitId": null
}
}
]
}
],
"totalItems": 1,
"totalPage": 1,
"currentPage": 1,
"limit": 10
}
Sipariş Durumu Güncelleme
Bu servis aracılığı ile Labs platformunda daha önce oluşturulan bir siparişin statüsünü ilerletebilirsiniz.
Geriye yönelik güncelleme yapılamaz, sadece ileriye doğru güncelleme yapılabilir. Örneğin "Yeni" durumundaki bir sipariş "Hazırlanıyor" olarak güncellenebilir ancak "Hazırlanıyor" statüsündeki bir sipariş "Yeni" olarak güncellenemez.
Sipariş Durum Kodları (statusCode)
[
0 => 'Onay Bekliyor',
1 => 'Yeni',
2 => 'Hazırlanıyor',
3 => 'Paketlendi',
4 => 'Kargoya Verildi',
5 => 'Tamamlandı'
6 => 'İptal Edildi'
7 => 'İade Sürecinde'
8 => 'İade Edildi'
]
Request
curl --location --request POST 'https://api.labsoffice.com/v1/orders/status' \
--header 'Authorization: Bearer {API_TOKEN}'
--header 'Content-Type: application/json' \
--data-raw '{
"orderId": 23655221,
"statusCode": 1
}'
Response
{
"status": "success",
"message": "Sipariş durumu başarıyla güncellendi"
}
Sipariş Sil
Bu servis aracılığı ile Labs platformundaki mevcut sipariş bilgilerinizi silebilirsiniz.
Request
curl --location --request DELETE 'https://api.labsoffice.com/v1/orders/2021' \
--header 'Authorization: Bearer {API_TOKEN}'
--header 'Content-Type: application/json' \
Response
{
"status": "success",
"message": "Sipariş başarılı bir şekilde silindi"
}
Pazaryeri Fatura PDF Gönderimi
Bu servis aracılığı ile pazaryeri platformlarına faturası kesilen siparişlerin PDF linklerini iletebilirsiniz.
Array[] formatında çoklu veri iletebilirsiniz.
Önemli Not : Bu servis şu anda geliştirme aşamasındadır. Şu anda sadece izin verilen hesapların kullanımına izin verilmektedir. Aktif olarak sadece Trendyol entegrasyonu çalışmaktadır. Diğer pazaryerlerinin geliştirme süreçleri devam etmektedir.
- Name
orderId
* zorunlu- Type
- integer
- Description
Labs platformuna ait orderId bilgisi
- Name
marketplace
* zorunlu- Type
- string
- Description
Kullanılabilir değerler : trendyol, hepsiburada, ciceksepeti
Geliştirmesi devam eden servisler : boyner, n11, flo
- Name
invoiceLink
* zorunlu- Type
- string
- Description
Faturaya ait pdf uzantılı indirilebilir fatura linki. Gönderilen fatura bağlantılarının hukuki zorunluluk gereği 10 yıl boyunca erişilebilir durumda olması gereklidir.
- Name
invoiceNumber
* zorunlu- Type
- string
- Description
Fatura numarası (örn : FRY2024000890123)
Fatura numarasının geçerli olabilmesi için aşağıdaki koşullara uyması gerekmektedir.
İlk üç hane; alfa numeric olmalı (Harf veya rakam).
Dört, beş, altı ve yedinci hane; bir yıla eşit olmalı. 2020'den 2099'a kadar olabilir.
Sekizinci haneden itibaren(son dokuz hane) numeric olmalı.
[3 digit(alphanumeric)][13 digit(numeric)]) Örnek invoiceNumber değerlerini aşağıdan inceleyebilirsiniz.
FRY2024567890123 -> Geçerli FR12024567890123 -> Geçerli F1Y2024567890123 -> Geçerli 1RY2024567890123 -> Geçerli 12Y2024567890123 -> Geçerli 1232024567890123 -> Geçerli F232024567890123 -> Geçerli FRY12345 -> Geçerli Değil
- Name
invoiceUuid
- Type
- string
- Description
Fatura UUID bilgisi, gönderilmesi zorunlu değildir.
- Name
invoiceDateTime
* zorunlu- Type
- string
- Description
Fatura gönderim zamanı, timestamp formatında saniye cinsinden 10 haneli olmalıdır.
Request
curl --location --request DELETE 'https://api.labsoffice.com/v1/orders/invoice-link' \
--header 'Authorization: Bearer {API_TOKEN}'
--header 'Content-Type: application/json' \
--data-raw '{
"payload" : [
{
"orderId" : 2506213, // labs order id
"marketplace" : "trendyol",
"invoiceLink": "https://extfatura.faturaentegratoru.com/324523-34523-52345-3453245.pdf",
"invoiceNumber": "1RY2024567890123",
"invoiceUuid": "324523-34523-52345-3453245", // opsiyonel
"invoiceDateTime": 1747729029 // timestamp
},
{
"orderId" : 2506214, // labs order id
"marketplace" : "trendyol",
"invoiceLink": "https://extfatura.faturaentegratoru.com/324523-34523-34555-3453246.pdf",
"invoiceNumber": "12Y2024567890123",
"invoiceUuid": "324523-34523-34555-3453246", // opsiyonel
"invoiceDateTime": 1747729029 // timestamp
}
]
}'
Response
{
"status": "success",
"message": "Fatura linkleri gönderilmek üzere sıraya alındı."
}