Web Kancaları Örnek Veriler

Ganipara Web Kancaları ile gönderilen veriler aşağıda formatta gönderilmektedir.

Web kancaları API ile yapılan işlemlerde tetiklenmez.

Web kancalarını nasıl yakalarım?

Örnek PHP Kodu

	$postdata = file_get_contents("php://input");
	$postdata = json_depre($postdata,TRUE);
	switch($postdata['webhook_event']){
	case "order_create":
	// Sipariş oluşturuldu web kancası bilgisi yakalanınca yapılacaklar
	break;
	}

Mağaza

Mağaza Güncellendi shop_update

{
   "webhook_event":"shop_update",
   "user_id":"317",
   "data":{
      "id":"317",
      "email":"aysegul@alanadi.com",
      "shop_id":"ankara",
      "first_name":"Ayşegül",
      "last_name":"Nazlı",
      "address":"Sümer 2.Sok No:36/2 Kızılay",
      "city":"Ankara",
      "city_pre":"6",
      "currency":"TRY",
      "domain":"ankara.ganipara.com",
      "domain_primary":"magaza.alanadi.com",
      "title":"Ev ve Ofis için tasarım ürünler",
      "description":"Evinizi ve ofisinizi tasarım ürünlerimiz ile keyifli hale getirin",
      "keywords":"ev,ofis,tasarım,dekoratif,el yapımı"
   }
}

Sipariş

Sipariş Oluşturuldu order_create

{
   "webhook_event":"order_create",
   "user_id":"317",
   "data":{
      "id":"625",
      "order_number":"SIPARIS-CHYJN-AC23S-HNJH61213",
      "order_date":"2013-12-06T12:29:12+0100",
      "ip":"198.167.2.12",
      "transaction_id":"3250",
      "status":"payment_complete",
      "payment_type":"creditcard",
      "gateway":"iyzico",
      "buyer":{
         "name":"Ayşegül Nazlı",
         "email":"aysegul@alanadi.com",
         "phone":"(532) 1111111"
      },
      "note":"",
      "currency":"TRY",
      "amount":"156.00",
      "amount_subtotal":"120.00",
      "amount_cargo":"30.00",
      "amount_giftwrap":"0.00",
      "amount_gateway":"6.00",
      "amount_discount":"0.00",
      "amount_installment":"0.00",
      "billing":{
         "type":"personal",
         "name":"Ayşegül Nazlı",
         "tax_office":"",
         "tax_number":"12345678901",
         "address":"Sümer 2.Sok No:36/2 Kızılay",
         "city":"Ankara",
         "country":"TR",
         "state":"",
         "zippre":"06650"
      },
      "shipping":{
         "name":"Berkay UNAL",
         "address":"Sümer 2.Sok No:36/2 Kızılay",
         "city":"Ankara",
         "country":"TR",
         "zippre":""
      },
      "has_download":false,
      "items":[
         {
            "id":"352",
            "product_id":"452",
            "name":"Dekoratif Apex Duvar Saati",
            "sub_name":"",
            "sku":"2.08A.CC2.F3B4",
            "type":"product",
            "product_type":"tangible",
            "unit_price":"60.00",
            "quantity":2,
            "total_price":"120.00",
            "status":"ready"
         }
      ],
      "product_ids":[
         "452"
      ],
      "invoice_data":{
         "title":"Ayşegül Nazlı",
         "tax_number":"12345678901",
         "tax_office":"",
         "address":"Sümer 2.Sok No:36/2 Kızılay Ankara Türkiye",
         "items":[
            {
               "line_type":"product",
               "name":"Dekoratif Apex Duvar Saati",
               "sub_name":"",
               "product_id":"452",
               "sku":"2.08A.CC2.F3B4",
               "quantity":2,
               "vat_rate":"18",
               "unit_price":{
                  "with_vat":"60.00",
                  "without_vat":"50.84",
                  "vat_amount":"9.16"
               },
               "total_price":{
                  "with_vat":"120.00",
                  "without_vat":"101.68",
                  "vat_amount":"18.32"
               }
            },
            {
               "line_type":"cargo",
               "name":"Kargo",
               "sub_name":"",
               "product_id":"",
               "sku":"",
               "quantity":"1",
               "vat_rate":"18",
               "unit_price":{
                  "with_vat":"30.00",
                  "without_vat":"25.42",
                  "vat_amount":"4.58"
               },
               "total_price":{
                  "with_vat":"30.00",
                  "without_vat":"25.42",
                  "vat_amount":"4.58"
               }
            },
            {
               "line_type":"gateway",
               "name":"Ödeme Altyapısı Komisyon Ücreti",
               "sub_name":"",
               "product_id":"",
               "sku":"",
               "quantity":"1",
               "vat_rate":"18",
               "unit_price":{
                  "with_vat":"6.00",
                  "without_vat":"5.08",
                  "vat_amount":"0.92"
               },
               "total_price":{
                  "with_vat":"6.00",
                  "without_vat":"5.08",
                  "vat_amount":"0.92"
               }
            }
         ],
         "vat":[
            {
               "rate":18,
               "amount":"23.82"
            },
            {
               "rate":8,
               "amount":"0.00"
            },
            {
               "rate":1,
               "amount":"0.00"
            }
         ],
         "sub_total":"132.18",
         "vat_total":"23.82",
         "discount":"0.00",
         "grand_total":"156.00"
      }
   }
}

Sipariş Güncellendi order_update

{
   "webhook_event":"order_update",
   "user_id":"317",
   "data":{
      "id":"625",
      "order_number":"SIPARIS-CHYJN-AC23S-HNJH61213",
      "order_date":"2013-12-06T12:29:12+0100",
      "ip":"198.167.2.12",
      "transaction_id":"3250",
      "status":"payment_complete",
      "payment_type":"creditcard",
      "gateway":"iyzico",
      "buyer":{
         "name":"Ayşegül Nazlı",
         "email":"aysegul@alanadi.com",
         "phone":"(532) 1111111"
      },
      "note":"",
      "currency":"TRY",
      "amount":"156.00",
      "amount_subtotal":"120.00",
      "amount_cargo":"30.00",
      "amount_giftwrap":"0.00",
      "amount_gateway":"6.00",
      "amount_discount":"0.00",
      "amount_installment":"0.00",
      "billing":{
         "type":"personal",
         "name":"Ayşegül Nazlı",
         "tax_office":"",
         "tax_number":"12345678901",
         "address":"Sümer 2.Sok No:36/2 Kızılay",
         "city":"Ankara",
         "country":"TR",
         "state":"",
         "zippre":"06650"
      },
      "shipping":{
         "name":"Berkay UNAL",
         "address":"Sümer 2.Sok No:36/2 Kızılay",
         "city":"Ankara",
         "country":"TR",
         "zippre":""
      },
      "has_download":false,
      "items":[
         {
            "id":"352",
            "product_id":"452",
            "name":"Dekoratif Apex Duvar Saati",
            "sub_name":"",
            "sku":"2.08A.CC2.F3B4",
            "type":"product",
            "product_type":"tangible",
            "unit_price":"60.00",
            "quantity":2,
            "total_price":"120.00",
            "status":"ready"
         }
      ],
      "product_ids":[
         "452"
      ],
      "invoice_data":{
         "title":"Ayşegül Nazlı",
         "tax_number":"12345678901",
         "tax_office":"",
         "address":"Sümer 2.Sok No:36/2 Kızılay Ankara Türkiye",
         "items":[
            {
               "line_type":"product",
               "name":"Dekoratif Apex Duvar Saati",
               "sub_name":"",
               "product_id":"452",
               "sku":"2.08A.CC2.F3B4",
               "quantity":2,
               "vat_rate":"18",
               "unit_price":{
                  "with_vat":"60.00",
                  "without_vat":"50.84",
                  "vat_amount":"9.16"
               },
               "total_price":{
                  "with_vat":"120.00",
                  "without_vat":"101.68",
                  "vat_amount":"18.32"
               }
            },
            {
               "line_type":"cargo",
               "name":"Kargo",
               "sub_name":"",
               "product_id":"",
               "sku":"",
               "quantity":"1",
               "vat_rate":"18",
               "unit_price":{
                  "with_vat":"30.00",
                  "without_vat":"25.42",
                  "vat_amount":"4.58"
               },
               "total_price":{
                  "with_vat":"30.00",
                  "without_vat":"25.42",
                  "vat_amount":"4.58"
               }
            },
            {
               "line_type":"gateway",
               "name":"Ödeme Altyapısı Komisyon Ücreti",
               "sub_name":"",
               "product_id":"",
               "sku":"",
               "quantity":"1",
               "vat_rate":"18",
               "unit_price":{
                  "with_vat":"6.00",
                  "without_vat":"5.08",
                  "vat_amount":"0.92"
               },
               "total_price":{
                  "with_vat":"6.00",
                  "without_vat":"5.08",
                  "vat_amount":"0.92"
               }
            }
         ],
         "vat":[
            {
               "rate":18,
               "amount":"23.82"
            },
            {
               "rate":8,
               "amount":"0.00"
            },
            {
               "rate":1,
               "amount":"0.00"
            }
         ],
         "sub_total":"132.18",
         "vat_total":"23.82",
         "discount":"0.00",
         "grand_total":"156.00"
      }
   }
}

Ürün

Ürün Oluşturuldu product_create Ürün Güncellendi product_update

Ürünün güncellenmesi durumunda “webhook_event” “product_update” olarak gönderilir

{
   "webhook_event":"product_create",
   "user_id":"317",
   "data":{
      "id":"2245",
      "slug":"apex-saat",
      "url":"http://ankara.ganipara.com/product/detail/2245/apex-saat",
      "type":"digital",
      "quantity_type":"number",
      "title":"Apex Saat",
      "description":"Ürün Açıklaması",
      "excerpt":"Kısa Açıklama",
      "visibility":"show",
      "is_discount":true,
      "discounted_price":"149.00",
      "tags":[
         "apex",
         "saat",
         "kırmızı"
      ],
      "is_photo":true,
      "photos":[
         {
            "photo_id":"219",
            "base_url":"http://cdn-merchant.ganipara.com",
            "path":"/assets/2/product/2245/",
            "filename":"resim1.jpg",
            "alt":"Yandan Görünün",
            "sort_order":0
         }
      ],
      "photo":{
         "photo_id":"219",
         "base_url":"http://cdn-merchant.ganipara.com",
         "path":"/assets/2/product/2245/",
         "filename":"resim1.jpg",
         "alt":"Yandan Görünün",
         "sort_order":0
      },
      "collections":[
         {
            "id":"1234"
         },
         {
            "id":"1237"
         },
         {
            "id":"1161"
         },
         {
            "id":"171"
         }
      ],
      "meta":{
         "title":"SEO meta başlığı",
         "description":"SEO meta açıklaması"
      },
      "date_created":"2013-12-06T09:52:28+0100",
      "date_updated":"2013-12-06T09:52:29+0100"
   }
}

Ürün Silindi product_delete

{
   "webhook_event":"product_delete",
   "user_id":"317",
   "data":{
      "id":"2245"
   }
}

Katalog

Katalog Oluşturuldu collection_create Katalog Güncellendi collection_update Katalog oluşturulması durumunda “webhook_event” “collection_create” olarak gönderilir

{
   "webhook_event":"collection_update",
   "user_id":"317",
   "data":{
      "id":"1234",
      "title":"İndirimdeki Ürünler",
      "description":"Bu fiyatları kaçırmayın",
      "slug":"discount",
      "products":[
         {
            "id":"53"
         },
         {
            "id":"225"
         },
         {
            "id":"226"
         },
         {
            "id":"227"
         },
         {
            "id":"228"
         },
         {
            "id":"229"
         },
         {
            "id":"230"
         },
         {
            "id":"231"
         },
         {
            "id":"232"
         },
         {
            "id":"234"
         },
         {
            "id":"235"
         },
         {
            "id":"224"
         },
         {
            "id":"223"
         },
         {
            "id":"71"
         },
         {
            "id":"74"
         },
         {
            "id":"75"
         },
         {
            "id":"78"
         },
         {
            "id":"79"
         },
         {
            "id":"89"
         },
         {
            "id":"111"
         },
         {
            "id":"115"
         },
         {
            "id":"124"
         },
         {
            "id":"222"
         },
         {
            "id":"245"
         }
      ],
      "meta":{
         "title":"SEO meta başlığı",
         "description":"SEO meta açıklaması"
      },
      "date_created":"2013-04-17T23:03:02+0200",
      "date_updated":"2013-12-01T14:09:52+0200"
   }
}
	

Katalog Silindi collection_delete

	{
   "webhook_event":"collection_delete",
   "user_id":"317",
   "data":{
      "id":"1234"
   }
}
	

Sayfa

Sayfa Oluşturuldu page_create Sayfa Güncellendi page_update

Sayfa oluşturulması durumunda “webhook_event” “page_create” olarak gönderilir.

{
   "webhook_event":"page_update",
   "user_id":"317",
   "data":{
      "id":"6103",
      "title":"Test Sayfasi",
      "content":"Sayfa içeriği",
      "slug":"test-sayfasi",
      "date_created":"2013-12-06T10:11:24+0100",
      "date_updated":"2013-12-06T10:11:24+0100",
      "published":true,
      "meta":{
         "title":"SEO meta başlığı",
         "description":"SEO meta açıklaması"
      }
   }
}
	

Sayfa Silindi page_delete

{
   "webhook_event":"page_delete",
   "user_id":"317",
   "data":{
      "id":"6103"
   }
}
	

Yine de yardıma ihtiyacınız mı var? Bize Ulaşın Bize Ulaşın