Le tutoriel suivant explique comment implémenter vos flux pour différencier les tarifs d'un service en fonction du membre du personnel associé, de l'heure et/ou du jour de la semaine.
Prix par membre du personnel/par heure
Vous devez définir quatre éléments:
Dans le flux du marchand, définissez un
Merchant.payment_option
pour chaque option de prix.- Définissez le
price
souhaité sur le prix du service pour l'heure/le personnel spécifiques. payment_option_id
doit être unique pour toute votre intégration, car les valeurspayment_option_id
sont partagées par tous les marchands du même agrégateur. Pour éviter toute confusion et simplifier le dépannage et la gestion, nous vous recommandons de (re)définir, pour chaque marchand, toutes les valeurspayment_option
qu'il utilise avec unpayment_option_id
unique (même si unpayment_option
identique est utilisé par un autre marchand).- Pour le prix par employé, nous vous recommandons de générer le
payment_option_id
en combinant lesmerchant_id
,service_id
etstaff_id
afin de faciliter le suivi et de vous assurer que lepayment_option_id
est unique pour l'ensemble de votre intégration. - Pour un prix par temps, nous vous recommandons de générer le
payment_option_id
en combinant lemerchant_id
, leservice_id
et une chaîne représentant ce temps (evening
,weekends
,sundayafternoon
, etc.) pour faciliter le suivi et vous assurer que lepayment_option_id
est unique dans l'ensemble de votre intégration.
- Lorsqu'ils sont utilisés pour la tarification au niveau de la disponibilité (cas d'utilisation de ce tutoriel), le nom et la description sont principalement utilisés à des fins de débogage.
- Ne définissez pas plus de 100 valeurs
payment_option
pour un même marchand. Si vous prévoyez d'atteindre plus de 100 valeurspayment_option
, veuillez exécuter cette implémentation avec votre contact Google. - Tous les autres champs
payment_option
peuvent être ignorés pour ce cas d'utilisation.
- Pour le prix par employé, nous vous recommandons de générer le
- Définissez le
Dans le flux de disponibilité, définissez
Availability.payment_option_id
sur un tableau d'un seul élément avec lepayment_option_id
de l'payment_option
que vous avez défini au niveau deMerchant
.Dans le flux de services, définissez
Service.price
sur la valeur la plus basse de la gamme de prix de ce service etService.price_interpretation
surSTARTS_AT
.
Exemple de tarif par collaborateur
Dans cet exemple, Robert (ID: 1) est un coiffeur plus expérimenté que Jane (ID : 2). Par conséquent, le propriétaire du salon a décidé de faire payer 5 $de plus pour une réservation chez Robert. Le prix d'une coupe de cheveux courte est de 20 $par défaut, et celui d'une coupe de cheveux longue est de 30 $par défaut. Si l'utilisateur sélectionne Robert, la coupe coûtera 25 $ou 35 $, respectivement.
Nom du membre du personnel | Coupe de cheveux courte | Coupe de cheveux longs |
---|---|---|
Jane | 20 $* | 30 $* |
Robert | 25 $ | 35 $ |
*Prix par défaut du service
{ "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 } } ] } ] }
{ "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" } ] } } ] }
{ "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"] } ] } ] }
Exemple de tarif par temps
Dans cet exemple, le salon est ouvert de 10h à 20h. Le propriétaire du salon a décidé d'ajouter un supplément de 5 $pour les réservations après 18h.
L'exemple de disponibilité est défini pour le samedi 1er septembre 2018 dans le fuseau horaire PT. 1535821200 correspond à 10h00 ce jour-là, 1535850000 à 18h00 et 1535857200 à 20h00.
Heure de la journée | Coupe de cheveux courte | Coupe de cheveux longs |
---|---|---|
10:00 à 11:00 | 20 $ | 30 $ |
11h00 à 12h00 | 20 $ | 30 $ |
12:00 - 13:00 | 20 $ | 30 $ |
13h00 à 14h00 | 20 $ | 30 $ |
14h00 à 15h00 | 20 $ | 30 $ |
15h00 à 16h00 | 20 $ | 30 $ |
16h00 à 17h00 | 20 $ | 30 $ |
17h00 à 18h00 | 20 $ | 30 $ |
18h00 à 19h00 | 25 $ | 35 $ |
19h00 à 20h00 | 25 $ | 35 $ |
{ "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 } } ] } ] }
{ "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" } ] } } ] }
{ "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"] } ] } ] }