Tutorial berikut menjelaskan cara menerapkan feed untuk membedakan harga layanan berdasarkan anggota staf terkait atau waktu hari dan/atau hari dalam seminggu.
Harga per staf/waktu
Ada 4 hal yang harus ditetapkan:
Di feed Penjual, tetapkan satu
Merchant.payment_option
untuk setiap opsi harga- Tetapkan
price
yang diinginkan ke harga layanan untuk waktu/staf tertentu payment_option_id
harus unik di seluruh integrasi Anda karena nilaipayment_option_id
dibagikan ke semua penjual dari agregator yang sama. Untuk menghindari kebingungan dan menyederhanakan pemecahan masalah serta pengelolaan, sebaiknya, untuk setiap penjual, Anda (menentukan ulang) semua nilaipayment_option
yang digunakan penjual ini denganpayment_option_id
unik (meskipunpayment_option
yang identik digunakan oleh penjual lain).- Untuk harga per staf, sebaiknya Anda membuat
payment_option_id
sebagai kombinasi darimerchant_id
,service_id
, danstaff_id
untuk memudahkan pelacakan dan memastikanpayment_option_id
unik di seluruh integrasi Anda - Untuk harga per waktu, sebaiknya buat
payment_option_id
sebagai kombinasi darimerchant_id
,service_id
, dan string yang mewakili waktu ini (evening
,weekends
,sundayafternoon
...) agar pelacakan lebih mudah dan untuk memastikanpayment_option_id
unik di seluruh integrasi Anda
- Jika digunakan untuk penetapan harga tingkat ketersediaan (kasus penggunaan tutorial ini), nama dan deskripsi terutama digunakan untuk tujuan proses debug
- Jangan menetapkan lebih dari 100 nilai
payment_option
untuk satu penjual. Jika Anda ingin mencapai lebih dari 100 nilaipayment_option
, jalankan penerapan ini oleh kontak Google Anda - Semua kolom
payment_option
lainnya dapat diabaikan untuk kasus penggunaan ini
- Untuk harga per staf, sebaiknya Anda membuat
- Tetapkan
Di feed Ketersediaan, tetapkan
Availability.payment_option_id
ke array item tunggal denganpayment_option_id
daripayment_option
yang ditentukan pada tingkatMerchant
Di feed Layanan, tetapkan
Service.price
ke nilai terendah dari rentang harga untuk layanan ini dan tetapkanService.price_interpretation
keSTARTS_AT
Contoh harga per staf
Dalam contoh ini, Robert (id: 1) adalah penata rambut yang lebih berpengalaman daripada Jane (id: 2), sehingga pemilik salon memutuskan untuk membuat reservasi untuk Robert dengan harga Rp5 lebih mahal. Biaya untuk potong rambut pendek adalah $20 secara default dan biaya untuk potong rambut panjang adalah $30 secara default. Jika pengguna memilih Robert, potongan rambutnya akan dikenakan biaya $25 atau $35.
Nama Staf | Potongan rambut pendek | Potongan rambut panjang |
---|---|---|
Jane | $20* | $30* |
Robert | $25 | $35 |
*harga default untuk layanan
Penjual
{ "metadata": { "processing_instruction": "PROCESS_AS_COMPLETE", "generation_timestamp": 1503638100, "total_shards": 1 }, "merchant": [ { "category": "beauty_salon", "merchant_id": "beauty-per-staff-price", "name": "Beauty Salon", "url": "www.merchantspublicsite.com", "telephone": "+1 123-456-7890", "geo": { "latitude": 37.422113, "longitude": -122.084041, "address": { "locality": "Mountain View", "country": "US", "region": "CA", "street_address": "1600 Amphitheatre Pkwy", "postal_code": "94043" } }, "payment_option": [ { "payment_option_id": "beauty-per-staff-price-haircut-short-1", "name": "Short haircut (Robert)", "description": "Short hair haircut price for Robert", "price": { "currency_code": "USD", "price_micros": 25000000 } }, { "payment_option_id": "beauty-per-staff-price-haircut-short-default", "name": "Short haircut (Default)", "description": "Normal short hair haircut price", "price": { "currency_code": "USD", "price_micros": 20000000 } }, { "payment_option_id": "beauty-per-staff-price-haircut-long-1", "name": "Long haircut (Robert)", "description": "Long hair haircut price for Robert", "price": { "currency_code": "USD", "price_micros": 35000000 } }, { "payment_option_id": "beauty-per-staff-price-haircut-long-default", "name": "Long haircut (Default)", "description": "Normal long hair haircut price", "price": { "currency_code": "USD", "price_micros": 30000000 } } ] } ] }
Layanan
{ "metadata": { "processing_instruction": "PROCESS_AS_COMPLETE", "generation_timestamp": 1535437200, "total_shards": 1 }, "service": [ { "service_id": "haircut-short", "prepayment_type": "NOT_SUPPORTED", "merchant_id": "beauty-per-staff-price", "price": { "currency_code": "USD", "price_micros": 20000000 }, "localized_service_name": { "value": "Haircut (shorter than shoulder)", "localized_value": [ { "locale": "en", "value": "Haircut (shorter than shoulder)" } ] }, "localized_description": { "value": "Awesome haircut for short hair", "localized_value": [ { "locale": "en", "value": "Awesome haircut for short hair" } ] } }, { "service_id": "haircut-long", "prepayment_type": "NOT_SUPPORTED", "merchant_id": "beauty-per-staff-price", "price": { "currency_code": "USD", "price_micros": 30000000 }, "localized_service_name": { "value": "Haircut (longer than shoulder)", "localized_value": [ { "locale": "en", "value": "Haircut (longer than shoulder)" } ] }, "localized_description": { "value": "Awesome haircut for long hair", "localized_value": [ { "locale": "en", "value": "Awesome haircut for long hair" } ] } } ] }
Ketersediaan
{ "metadata": { "processing_instruction": "PROCESS_AS_COMPLETE", "generation_timestamp": 1535178900, "total_shards": 1 }, "service_availability": [ { "availability": [ { "spots_total": 1, "start_sec": 1535806800, "spots_open": 1, "duration_sec": 3600, "recurrence": { "repeat_until_sec": 1535846340, "repeat_every_sec": 3600 }, "service_id": "haircut-short", "merchant_id": "beauty-per-staff-price", "resources": { "staff_name": "Robert", "staff_id": "1" }, "payment_option_id": ["beauty-per-staff-price-haircut-short-1"] }, { "spots_total": 1, "start_sec": 1535806800, "spots_open": 1, "duration_sec": 3600, "recurrence": { "repeat_until_sec": 1535846340, "repeat_every_sec": 3600 }, "service_id": "haircut-long", "merchant_id": "beauty-per-staff-price", "resources": { "staff_name": "Robert", "staff_id": "1" }, "payment_option_id": ["beauty-per-staff-price-haircut-long-1"] }, { "spots_total": 1, "start_sec": 1535806800, "spots_open": 1, "duration_sec": 3600, "recurrence": { "repeat_until_sec": 1535846340, "repeat_every_sec": 3600 }, "service_id": "haircut-short", "merchant_id": "beauty-per-staff-price", "resources": { "staff_name": "Jane", "staff_id": "2" }, "payment_option_id": ["beauty-per-staff-price-haircut-short-default"] }, { "spots_total": 1, "start_sec": 1535806800, "spots_open": 1, "duration_sec": 3600, "recurrence": { "repeat_until_sec": 1535846340, "repeat_every_sec": 3600 }, "service_id": "haircut-long", "merchant_id": "beauty-per-staff-price", "resources": { "staff_name": "Jane", "staff_id": "2" }, "payment_option_id": ["beauty-per-staff-price-haircut-long-default"] } ] } ] }
Contoh harga per waktu
Dalam contoh ini, salon buka dari pukul 10.00 hingga 20.00. Pemilik salon memutuskan untuk menambahkan biaya tambahan sebesar $5 untuk pemesanan setelah pukul 18.00.
Contoh ketersediaan ditentukan untuk Sabtu, 1 September 2018 di zona waktu PT. 1535821200 adalah pukul 10.00 pada hari tersebut, 1535850000 adalah pukul 18.00 pada hari tersebut, dan 1535857200 adalah pukul 20.00.
Waktu | Potongan rambut pendek | Potongan rambut panjang |
---|---|---|
10.00 ~ 11.00 | $20 | $30 |
11.00 ~ 12.00 | $20 | $30 |
12.00 ~ 13.00 | $20 | $30 |
13.00 ~ 14.00 | $20 | $30 |
14.00 ~ 15.00 | $20 | $30 |
15.00 ~ 16.00 | $20 | $30 |
16.00 ~ 17.00 | $20 | $30 |
17.00 ~ 18.00 | $20 | $30 |
18.00 ~ 19.00 | $25 | $35 |
19.00 ~ 20.00 | $25 | $35 |
Penjual
{ "metadata": { "processing_instruction": "PROCESS_AS_COMPLETE", "generation_timestamp": 1503638100, "total_shards": 1 }, "merchant": [ { "category": "beauty_salon", "merchant_id": "beauty-per-time-price", "name": "Beauty Salon", "url": "www.merchantspublicsite.com", "telephone": "+1 123-456-7890", "geo": { "latitude": 37.422113, "longitude": -122.084041, "address": { "locality": "Mountain View", "country": "US", "region": "CA", "street_address": "1600 Amphitheatre Pkwy", "postal_code": "94043" } }, "payment_option": [ { "payment_option_id": "beauty-per-time-price-haircut-short-evening", "name": "Short haircut (Evening)", "description": "Short hair haircut price for the evening", "price": { "currency_code": "USD", "price_micros": 25000000 } }, { "payment_option_id": "beauty-per-time-price-haircut-short-default", "name": "Short haircut (Normal)", "description": "Short hair haircut price for the rest of the day", "price": { "currency_code": "USD", "price_micros": 21000000 } }, { "payment_option_id": "beauty-per-time-price-haircut-long-evening", "name": "Long haircut (Evening)", "description": "Long hair haircut price for the evening", "price": { "currency_code": "USD", "price_micros": 35000000 } }, { "payment_option_id": "beauty-per-time-price-haircut-long-default", "name": "Long haircut (Normal)", "description": "Long hair haircut price for the rest of the day", "price": { "currency_code": "USD", "price_micros": 31000000 } } ] } ] }
Layanan
{ "metadata": { "processing_instruction": "PROCESS_AS_COMPLETE", "generation_timestamp": 1535437200, "total_shards": 1 }, "service": [ { "service_id": "haircut-short", "prepayment_type": "NOT_SUPPORTED", "merchant_id": "beauty-per-time-price", "price": { "currency_code": "USD", "price_micros": 2100000 }, "localized_service_name": { "value": "Haircut (shorter than shoulder)", "localized_value": [ { "locale": "en", "value": "Haircut (shorter than shoulder)" } ] }, "localized_description": { "value": "Awesome haircut for short hair", "localized_value": [ { "locale": "en", "value": "Awesome haircut for short hair" } ] } }, { "service_id": "haircut-long", "prepayment_type": "NOT_SUPPORTED", "merchant_id": "beauty-per-time-price", "price": { "currency_code": "USD", "price_micros": 31000000 }, "localized_service_name": { "value": "Haircut (longer than shoulder)", "localized_value": [ { "locale": "en", "value": "Haircut (longer than shoulder)" } ] }, "localized_description": { "value": "Awesome haircut for long hair", "localized_value": [ { "locale": "en", "value": "Awesome haircut for long hair" } ] } } ] }
Ketersediaan
{ "metadata": { "processing_instruction": "PROCESS_AS_COMPLETE", "generation_timestamp": 1535178900, "total_shards": 1 }, "service_availability": [ { "availability": [ { "spots_total": 1, "start_sec": 1535821200, "spots_open": 1, "duration_sec": 3600, "recurrence": { "repeat_until_sec": 1535849940, "repeat_every_sec": 3600 }, "service_id": "haircut-short", "merchant_id": "beauty-per-time-price", "payment_option_id": ["beauty-per-time-price-haircut-short-default"] }, { "spots_total": 1, "start_sec": 1535821200, "spots_open": 1, "duration_sec": 3600, "recurrence": { "repeat_until_sec": 1535849940, "repeat_every_sec": 3600 }, "service_id": "haircut-long", "merchant_id": "beauty-per-time-price", "payment_option_id": ["beauty-per-time-price-haircut-long-default"] }, { "spots_total": 1, "start_sec": 1535850000, "spots_open": 1, "duration_sec": 3600, "recurrence": { "repeat_until_sec": 1535857140, "repeat_every_sec": 3600 }, "service_id": "haircut-short", "merchant_id": "beauty-per-time-price", "payment_option_id": ["beauty-per-time-price-haircut-short-evening"] }, { "spots_total": 1, "start_sec": 1535850000, "spots_open": 1, "duration_sec": 3600, "recurrence": { "repeat_until_sec": 1535857140, "repeat_every_sec": 3600 }, "service_id": "haircut-long", "merchant_id": "beauty-per-time-price", "payment_option_id": ["beauty-per-time-price-haircut-long-evening"] } ] } ] }