Başlarken
Genel Bakış
Adisyo Cafe Restoran uygulamasına kayıtlı restoranınıza dilerseniz ilgili endpoint ve birkaç konfigürasyon ile sipariş giriş işlemini yapabilirsiniz. Aşağıda belirtilen birkaç basit adım ile ilk siparişinizi hemen girebilirsiniz;
1- İlgili restorantın adisyo uygulamasında yer alan ürün listesini x-api-key ve x-api-secret bilgileri ile ’https://ext.adisyo.com/api/external/GetExternalProducts’ adresinden çekmek. GET metodu ile istek gönderilmelidir.
2- Adisyo uygulamasından alınan ‘x-api-key’ ve ‘x-api-secret’ bilgilerini ilgili http request header’ına eklemek.
3- Sipariş objesini oluşturmak (JSON).
4- Sipariş objesi ve adisyo yetkililerinden alınan x-api-key ve x-api-secret bilgileri ile ’https://ext.adisyo.com/api/external/SaveExternalOrder’ adresine request gönderilebilir. POST metodu kullanılmalıdır.
Api Key ve Secret Key Bilgilerini Alma
Entegrasyon sağlanacak her bir restoran için adisyo yetkilileri tarafından paylaşılan x-api-key ve x-api-secret bilgileridir. Bu bilgiler gönderilecek Http request’inin header alanında yer almalıdır ve belirtilen formatta olmalıdır, aksi halde işlem gerçekleşmeyecektir. x-api-key ve x-api-secret bilgileri için lütfen adisyo ile iletişime geçiniz.
Ürün Listesini Görüntüleme
İlgili restorantın adisyo uygulamasında yer alan ürün listesini x-api-key ve x-api-secret bilgileri ile ’https://ext.adisyo.com/api/external/GetExternalProducts’ adresinden çekmek. GET metodu ile istek gönderilmelidir.
Örnek Request
curl https://ext.adisyo.com/api/external/GetExternalProducts
Örnek Response
{
"productName": "Hamburger"
"productCode": null,
"features": [
{
"featureName": "Ekstra Peynir",
"featureId": 968348,
"featureCode": null,
"productId": 2267678,
"additionalPrice": 3.00",
"featureHeaderName": "Hamburger İçerik",
},
{
"featureName": "Ekstra Köfte",
"featureId": 968351,
"featureCode": null,
"productId": 2267678,
"additionalPrice": 6.00",
"featureHeaderName": "Hamburger İçerik",
},
{
"featureName": "Mantar",
"featureId": 968359,
"featureCode": null,
"productId": 2267678,
"additionalPrice": 3.00",
"featureHeaderName": "Hamburger İçerik",
},
],
"productUnits": [
{
"unitName": "Tam",
"price": 12.00,
"productUnitId": 2408389,
},
],
"menus": [
{
"menuName": "Büyük Boy Menü( 1lt İçecek)",
"subProducts": [
{
"productName": "Su",
"productCode": null,
"productUnitId": 2408366
},
{
"productName": "Ayran",
"productCode": null,
"productUnitId": 2408367
},
{
"productName": "Coca Cola",
"productCode": null,
"productUnitId": 2408368
}, {
"productName": "Soda",
"productCode": null,
"productUnitId": 2408369
}, {
"productName": "Ice Tea",
"productCode": null,
"productUnitId": 2408370
},
]
}
],
"excludedFeatures": [
{
"featureName": "Tiramisu",
"featureId": 2408376,
"featureCode": null,
"productId": 2267678
}
{
"featureName": "Türk Kahvesi",
"featureId": 2408362,
"featureCode": null,
"productId": 2267678
}
]
}
Endpoint
GET /api/external/GetExternalProducts
Gerekli Parametreler
-
x-api-key
- Hesabınızın API keyi -
x-api-secret
- Hesabınızın API Secret keyi
Sipariş Objesini Oluşturmak
Örnek Sipariş Objesi
{
"CustomerName": "Christian",
"CustomerSurname": "Luyindama",
"CustomerId": "44545",
"CustomerPhone": "5554443444",
"CustomerPhone2": "5554443441",
"Address": "adres bilgisi...",
"AddressDescription": "adres tarif",
"Region": "Ataşehir",
"City": "İstanbul",
"PaymentMethodId": "3",
"PaymentNote": "temassız çalışmıyorr",
"Discount": "20",
"OrderNote": "ıslak mendil getirin",
"WebOrderId": "746364",
"OrderTotal": "20.00",
"OrderDetails":
[
{
"Quantity": 4,
"ProductUnitId": 43455,
"OrderDetailNote": "çıtır olsun",
"Features":
[
{
"Name": "Soğansız",
"FeatureId": "322343"
} ,{...},{...}
],
"IsMenu": "true/false",
"MenuId": "1",
"ParentId": "1"
}
]
}
Sipariş objesi JSON formatında olmalı. Sipariş içinde temel bilgiler, siparişte yer alan ürünler ve bu ürünlere ait bazı bilgiler bulunur. Aşağıda her bir parametre ayrı ayrı açıklanmıştır ;
-
CustomerName
- Siparişi veren kullanıcının adı -
CustomerSurname
- Siparişi veren kullanıcının soyadı -
CustomerId
- Kendi sisteminize kayıtlı kullanıcının ID’si, yoksa boş bırakın -
CustomerPhone
- Siparişi veren kullanıcının telefon numarası -
CustomerPhone2
- Siparişi veren kullanıcının 2. telefon numarası -
Address
- Siparişi veren kullanıcnın adresi -
AddressDescription
- Siparişi veren kullanıcnın adres tarifi -
Region
- Siparişi veren kullanıcnın semt-ilçe bilgisi -
City
- Siparişi veren kullanıcının şehir bilgisi -
PaymentMethodId
- Ödeme tipi bilgisi, ödeme tipleri listesi aşağıda vardır -
PaymentNote
- Ödeme notu -
Discount
- Siparişteki toplam indirim tutarı -
OrderNote
- Sipariş notu -
WebOrderId
- Kendi sisteminizde yer alan sipariş ID’si -
OrderTotal
- Sipariş Toplam Tutarı -
ParentId
-Ana ürünün ID'si
Ödeme Yöntemini Belirleme
Sipariş objesi bu şekilde hazır hale getirilir. Ödeme tipi alanına gelebilecek seçenekler yine adisyo sisteminde kullanılan değerlerden biri ile doldurulmalıdır. Ödeme tipi listesi aşağıdaki gibidir ;
-
Nakit
: 1 -
Kredi Kartı
: 2 -
Multinet
: 3 -
SmartTicket
: 4 -
Setcard
: 5 -
Sodexo
: 6 -
Diğer
: 7 -
Basit Otel
: 22 -
BizimHesap
: 24 -
Metropol
: 26 -
Açık Hesap
: 27 -
HMS Otel
: 28 -
YS Online
: 29 -
Glovo
: 30 -
Cüzdan
: 31 -
Getir
: 33 -
Sedna
: 34 -
Sodexo Online
: 41 -
Paye
: 52 -
Web Online
: 53 -
Chippin
: 63 -
Zomato
: 65 -
Maximum Mobile
: 88 -
Paycell
: 89 -
Trendyol
: 90 -
Sodexo Pass Mobil
: 91 -
FastPay
: 92 -
Fuudy
: 93 -
Sodexo Cep Pos
: 97 -
CIO Kart
: 98
Hazırlanan Request’i Göndermek
Örnek Request
curl -X POST https://ext.adisyo.com/api/external/SaveExternalOrder
Örnek Success Response
{
"orderId": 66297940,
"orderTotal": 20.00,
"discount": -4.00,
"insertedDate": "2022-06-12T19:33:12.033",
"errorMessage": null,
"status": 1
}
Örnek Fail Response
{
"orderId": 0,
"orderTotal": 0.0,
"discount": 0.0,
"insertedDate": "0001-01-01T00:00:00",
"errorMessage": "Sipariş kaydedilirken bir hata oluştu, lütfen tekrar deneyin veya Adisyo destek ile iletişime
geçiniz.",
"status": 0
}
Http requestinin header alanına ilgili restorana ait x-api-key ve x-api-secret bilgileri girilmiş, sipariş objesi de örnekteki haliyle hazırlanmış şekilde son aşamaya gelinir. Buradan itibaren yapılması gereken ise sadece hazırlanan request’i post metodu ile belirtilen endpoint adresine göndermek.
Endpoint
GET /api/external/SaveExternalOrder
Gerekli Parametreler
-
x-api-key
- Hesabınızın API keyi -
x-api-secret
- Hesabınızın API Secret keyi
Response Tipleri
-
Success (1)
- İşlem başarılı olduysa sipariş adisyo sistemine aktarılmış demektir. Response olarak siparişe ait genel bilgiler, ‘Status’ bilgisi (başarılı işlemlerde 1 olarak döner) ve siparişin Adisyo sistemine kaydedildiği tarih/saat bilgisi döner. -
Fail (0)
- Siparişi kaydetme esnasında yaşanan bir hata var ise işlem başarısız olarak kabul edilir ve adisyo sistemine herhangi bir kayıt düşmez. Response olarak ‘Status’ bilgisi ( başarısız işlemlerde 0 olarak döner) , hataya sebep olan işlemin açıklaması ‘ErrorMessage’ döner.
Siparişleri Görüntüleme
Örnek Request
curl https://ext.adisyo.com/api/external/GetExternalOrders
Örnek Response
{
"orders": [
{
"id": 66473932,
"waiterName": "Garson1",
"deliveryUserName": null,
"externalAppName": "Adisyo",
"restaurantName": null,
"orderTotal": 6,
"paymentMethodName": "SetCard",
"paymentMethodId": 5,
"deliveryTime": null,
"discountAmount": 0.00,
"currency": "TRY",
"orderNote": null,
"externalAppId": null,
"statusId": 9,
"status": "İptal",
"orderCancelReason": "Müşteri siparişi iptal etti",
"tableName": null,
"orderNumber": 100,
"taxAmount": 0.44,
"insertDate": "2022-06-14T10:19:30.317",
"updateDate": "2022-06-14T10:19:30.317",
"customerId": 1767682,
"customerLatitude": null,
"customerLongitude": null,
"confirmationCode": null,
"integrationRestaurantName": null,
"addressId": 1766443,
"customer": {
"customerName": "Baver Bölüm",
"customerSurname": null,
"customerEmail": null,
"customerId": "1767682",
"customerPhone": "5453454545",
"customerPhone2": null,
"address": "asd",
"addressDescription": null,
"region": null,
"addressHeader": null,
"city": null,
"company": null,
"phoneCode": null,
"addressId": 0,
"isDefault": null,
},
"products": [
{
"id": 213829215,
"orderId": 66473932,
"quantity": 1.00,
"unitPrice": 6.00,
"productName": "Türk Kahvesi",
"productNote": 66473932,
"isMenu": false,
"parentId": null,
"cost": 0.0,
"totalAmount": 6.00,
"groupName": null,
"groupId": 0,
"discountAmount": 0.00,
"insertDate": "2022-06-14T10:19:30.333",
"description": null,
"cancelReason": null,
"excludedComposites": null,
"excludedItems": [],
"features": [
{
"featureName": "Brownie",
"AdditionalPrice": 4.00,
"featureId": 2408384,
"OrderDetailId": 53455
},
{
"featureName": "Tiramisu",
"AdditionalPrice": 4.00,
"featureId": 2408376,
"OrderDetailId": 53455
}
],
}
],
"payments": []
}
],
"result": 1,
"errorMessage": null,
"totalOrderCount": 1,
"pageCount": 1
}
İlgili restorantın adisyo uygulamasında yer alan ürün listesini x-api-key ve x-api-secret bilgileri ile ’https://ext.adisyo.com/api/external/GetExternalOrders adresinden çekmek. GET metodu ile istek gönderilmelidir.
Endpoint
GET /api/external/GetExternalOrders
Gerekli Parametreler
-
x-api-key
- Hesabınızın API keyi -
x-api-secret
- Hesabınızın API Secret keyi
Opsiyonel Parametreler
-
pageIndex
- Sipariş sayısı 50'den yüksek olduğunda veriler sayfalanır. Index ile verilere erişilebilir. Default olarak ilk sayfayı getirir. Diğer sayfalara erişmek için bu alanı doldurmanız gerekmektedir. -
minimumOrderId
- Sipariş numarası minimumOrderId değişkeninden büyük olan siparişleri döndürür. -
updatedOrdersAfter
- Güncellenen siparişlere erişmek için kullanılabilir. Güncelleme tarihi bu parametreden gönderilen tarihten sonra olan siparişleri getirir. (Örn. yyyy-mm-dd hh:mm:ss - 2022-06-13 15:15:19) -
includeCancelledOrders
- Sipariş numarası veya tarih şartını sağlayan iptal edilmiş siparişleri de döndürür.
Response Tipleri
-
Success (1)
- Response olarak siparişe ait genel bilgiler, ‘Result’ bilgisi (başarılı işlemlerde 1 olarak döner) ve Adisyo sisteminde kayıtlı güncel sipariş sayısı ve sayfa sayısı bilgisi döner. -
Fail (0)
- Parametreler formata uygun gönderilmediğinde response olarak ‘Result’ bilgisi ( başarısız işlemlerde 0 olarak döner) ve hataya sebep olan ‘ErrorMessage’ döner.
Açık Siparişleri Görüntüleme
Örnek Request
curl https://ext.adisyo.com/api/external/HemenYoldaOrders
Örnek Response
{
"orders": [
{
"id": 66473932,
"waiterName": "hemenyolda",
"deliveryUserName": null,
"externalAppName": "Adisyo",
"restaurantName": null,
"orderTotal": 6,
"paymentMethodName": "SetCard",
"paymentMethodId": 5,
"deliveryTime": null,
"discountAmount": 0.00,
"currency": "TRY",
"orderNote": null,
"externalAppId": null,
"statusId": 1,
"status": "Sipariş Alındı",
"orderCancelReason": null,
"tableName": null,
"orderNumber": 100,
"taxAmount": 0.44,
"insertDate": "2022-06-14T10:19:30.317",
"updateDate": "2022-06-14T10:19:30.317",
"customerId": 1767682,
"customerLatitude": null,
"customerLongitude": null,
"confirmationCode": null,
"integrationRestaurantName": null,
"addressId": 1766443,
"customer": {
"customerName": "Baver Bölüm",
"customerSurname": null,
"customerEmail": null,
"customerId": "1767682",
"customerPhone": "5453454545",
"customerPhone2": null,
"address": "asd",
"addressDescription": null,
"region": null,
"addressHeader": null,
"city": null,
"company": null,
"phoneCode": null,
"addressId": 0,
"isDefault": null,
},
"products": [
{
"id": 213829215,
"orderId": 66473932,
"quantity": 1.00,
"unitPrice": 6.00,
"productName": "Türk Kahvesi",
"productNote": 66473932,
"isMenu": false,
"parentId": null,
"cost": 0.0,
"totalAmount": 6.00,
"groupName": null,
"groupId": 0,
"discountAmount": 0.00,
"insertDate": "2022-06-14T10:19:30.333",
"description": null,
"cancelReason": null,
"excludedComposites": null,
"excludedItems": [],
"features": [
{
"featureName": "Brownie",
"AdditionalPrice": 4.00,
"featureId": 2408384,
"OrderDetailId": 53455
},
{
"featureName": "Tiramisu",
"AdditionalPrice": 4.00,
"featureId": 2408376,
"OrderDetailId": 53455
}
],
}
],
"payments": []
}
],
"result": 1,
"errorMessage": null,
"totalOrderCount": 1,
"pageCount": 1
}
İlgili restorantın adisyo uygulamasında yer alan ürün listesini x-api-key ve x-api-secret bilgileri ile ’https://ext.adisyo.com/api/external/HemenYoldaOrders’ adresinden çekmek. GET metodu ile istek gönderilmelidir.
Endpoint
GET /api/external/HemenYoldaOrders
Gerekli Parametreler
-
x-api-key
- Hesabınızın API keyi -
x-api-secret
- Hesabınızın API Secret keyi
Opsiyonel Parametreler
-
pageIndex
- Sipariş sayısı 50'den yüksek olduğunda veriler sayfalanır. Index ile verilere erişilebilir. Default olarak ilk sayfayı getirir. Diğer sayfalara erişmek için bu alanı doldurmanız gerekmektedir. -
minimumOrderId
- Sipariş numarası minimumOrderId değişkeninden büyük olan siparişleri döndürür. -
updatedOrdersAfter
- Güncellenen siparişlere erişmek için kullanılabilir. Güncelleme tarihi bu parametreden gönderilen tarihten sonra olan siparişleri getirir. (Örn. yyyy-mm-dd hh:mm:ss - 2022-06-13 15:15:19)
Response Tipleri
-
Success (1)
- Response olarak siparişe ait genel bilgiler, ‘Result’ bilgisi (başarılı işlemlerde 1 olarak döner) ve Adisyo sisteminde kayıtlı güncel sipariş sayısı ve sayfa sayısı bilgisi döner. -
Fail (0)
- Parametreler formata uygun gönderilmediğinde response olarak ‘Result’ bilgisi ( başarısız işlemlerde 0 olarak döner) ve hataya sebep olan ‘ErrorMessage’ döner.